summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/AUTHORS10
-rw-r--r--bitbake/COPYING339
-rw-r--r--bitbake/ChangeLog317
-rw-r--r--bitbake/HEADER19
-rw-r--r--bitbake/LICENSE10
-rwxr-xr-xbitbake/bin/bitbake362
-rwxr-xr-xbitbake/bin/bitbake-diffsigs122
-rwxr-xr-xbitbake/bin/bitbake-dumpsig65
-rwxr-xr-xbitbake/bin/bitbake-layers726
-rwxr-xr-xbitbake/bin/bitbake-prserv55
-rwxr-xr-xbitbake/bin/bitbake-selftest49
-rwxr-xr-xbitbake/bin/bitbake-worker375
-rwxr-xr-xbitbake/bin/bitdoc531
-rwxr-xr-xbitbake/bin/image-writer122
-rwxr-xr-xbitbake/bin/toaster214
-rw-r--r--bitbake/contrib/README1
-rw-r--r--bitbake/contrib/bbdev.sh31
-rwxr-xr-xbitbake/contrib/dump_cache.py68
-rw-r--r--bitbake/contrib/vim/ftdetect/bitbake.vim24
-rw-r--r--bitbake/contrib/vim/ftplugin/bitbake.vim2
-rwxr-xr-xbitbake/contrib/vim/plugin/newbb.vim85
-rw-r--r--bitbake/contrib/vim/syntax/bitbake.vim126
-rw-r--r--bitbake/doc/COPYING.GPL339
-rw-r--r--bitbake/doc/COPYING.MIT17
-rw-r--r--bitbake/doc/Makefile91
-rw-r--r--bitbake/doc/README39
-rw-r--r--bitbake/doc/bitbake-user-manual/bitbake-user-manual-customization.xsl15
-rw-r--r--bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.xml850
-rw-r--r--bitbake/doc/bitbake-user-manual/bitbake-user-manual-fetching.xml622
-rw-r--r--bitbake/doc/bitbake-user-manual/bitbake-user-manual-hello.xml506
-rw-r--r--bitbake/doc/bitbake-user-manual/bitbake-user-manual-intro.xml644
-rw-r--r--bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml1712
-rw-r--r--bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.xml2132
-rw-r--r--bitbake/doc/bitbake-user-manual/bitbake-user-manual-style.css978
-rw-r--r--bitbake/doc/bitbake-user-manual/bitbake-user-manual.xml88
-rw-r--r--bitbake/doc/bitbake-user-manual/figures/bitbake-title.pngbin0 -> 5086 bytes
-rw-r--r--bitbake/doc/bitbake-user-manual/html.css281
-rw-r--r--bitbake/doc/bitbake.1142
-rw-r--r--bitbake/doc/poky.ent59
-rw-r--r--bitbake/doc/template/Vera.ttfbin0 -> 65932 bytes
-rw-r--r--bitbake/doc/template/Vera.xml1
-rw-r--r--bitbake/doc/template/VeraMoBd.ttfbin0 -> 49052 bytes
-rw-r--r--bitbake/doc/template/VeraMoBd.xml1
-rw-r--r--bitbake/doc/template/VeraMono.ttfbin0 -> 49224 bytes
-rw-r--r--bitbake/doc/template/VeraMono.xml1
-rw-r--r--bitbake/doc/template/db-pdf.xsl64
-rw-r--r--bitbake/doc/template/draft.pngbin0 -> 24847 bytes
-rw-r--r--bitbake/doc/template/fop-config.xml58
-rw-r--r--bitbake/doc/template/titlepage.templates.xml1259
-rwxr-xr-xbitbake/doc/tools/docbook-to-pdf51
-rw-r--r--bitbake/lib/bb/COW.py323
-rw-r--r--bitbake/lib/bb/__init__.py143
-rw-r--r--bitbake/lib/bb/build.py709
-rw-r--r--bitbake/lib/bb/cache.py847
-rw-r--r--bitbake/lib/bb/cache_extra.py75
-rw-r--r--bitbake/lib/bb/checksum.py90
-rw-r--r--bitbake/lib/bb/codeparser.py328
-rw-r--r--bitbake/lib/bb/command.py444
-rw-r--r--bitbake/lib/bb/compat.py6
-rw-r--r--bitbake/lib/bb/cooker.py1874
-rw-r--r--bitbake/lib/bb/cookerdata.py305
-rw-r--r--bitbake/lib/bb/daemonize.py190
-rw-r--r--bitbake/lib/bb/data.py403
-rw-r--r--bitbake/lib/bb/data_smart.py804
-rw-r--r--bitbake/lib/bb/event.py641
-rw-r--r--bitbake/lib/bb/exceptions.py91
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py1575
-rw-r--r--bitbake/lib/bb/fetch2/bzr.py143
-rw-r--r--bitbake/lib/bb/fetch2/cvs.py171
-rw-r--r--bitbake/lib/bb/fetch2/git.py355
-rw-r--r--bitbake/lib/bb/fetch2/gitannex.py76
-rw-r--r--bitbake/lib/bb/fetch2/gitsm.py126
-rw-r--r--bitbake/lib/bb/fetch2/hg.py187
-rw-r--r--bitbake/lib/bb/fetch2/local.py116
-rw-r--r--bitbake/lib/bb/fetch2/osc.py135
-rw-r--r--bitbake/lib/bb/fetch2/perforce.py194
-rw-r--r--bitbake/lib/bb/fetch2/repo.py98
-rw-r--r--bitbake/lib/bb/fetch2/sftp.py129
-rw-r--r--bitbake/lib/bb/fetch2/ssh.py127
-rw-r--r--bitbake/lib/bb/fetch2/svn.py191
-rw-r--r--bitbake/lib/bb/fetch2/wget.py106
-rw-r--r--bitbake/lib/bb/methodpool.py29
-rw-r--r--bitbake/lib/bb/monitordisk.py265
-rw-r--r--bitbake/lib/bb/msg.py196
-rw-r--r--bitbake/lib/bb/namedtuple_with_abc.py255
-rw-r--r--bitbake/lib/bb/parse/__init__.py157
-rw-r--r--bitbake/lib/bb/parse/ast.py478
-rw-r--r--bitbake/lib/bb/parse/parse_py/BBHandler.py267
-rw-r--r--bitbake/lib/bb/parse/parse_py/ConfHandler.py189
-rw-r--r--bitbake/lib/bb/parse/parse_py/__init__.py33
-rw-r--r--bitbake/lib/bb/persist_data.py215
-rw-r--r--bitbake/lib/bb/process.py133
-rw-r--r--bitbake/lib/bb/providers.py381
-rw-r--r--bitbake/lib/bb/pysh/__init__.py0
-rw-r--r--bitbake/lib/bb/pysh/builtin.py710
-rw-r--r--bitbake/lib/bb/pysh/interp.py1367
-rw-r--r--bitbake/lib/bb/pysh/lsprof.py116
-rw-r--r--bitbake/lib/bb/pysh/pysh.py167
-rw-r--r--bitbake/lib/bb/pysh/pyshlex.py888
-rw-r--r--bitbake/lib/bb/pysh/pyshyacc.py779
-rw-r--r--bitbake/lib/bb/pysh/sherrors.py41
-rw-r--r--bitbake/lib/bb/pysh/subprocess_fix.py77
-rw-r--r--bitbake/lib/bb/runqueue.py2154
-rw-r--r--bitbake/lib/bb/server/__init__.py96
-rw-r--r--bitbake/lib/bb/server/process.py236
-rw-r--r--bitbake/lib/bb/server/xmlrpc.py392
-rw-r--r--bitbake/lib/bb/shell.py820
-rw-r--r--bitbake/lib/bb/siggen.py483
-rw-r--r--bitbake/lib/bb/taskdata.py651
-rw-r--r--bitbake/lib/bb/tests/__init__.py0
-rw-r--r--bitbake/lib/bb/tests/codeparser.py375
-rw-r--r--bitbake/lib/bb/tests/cow.py136
-rw-r--r--bitbake/lib/bb/tests/data.py296
-rw-r--r--bitbake/lib/bb/tests/fetch.py562
-rw-r--r--bitbake/lib/bb/tests/utils.py53
-rw-r--r--bitbake/lib/bb/tinfoil.py96
-rw-r--r--bitbake/lib/bb/ui/__init__.py17
-rw-r--r--bitbake/lib/bb/ui/buildinfohelper.py964
-rw-r--r--bitbake/lib/bb/ui/crumbs/__init__.py17
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/builddetailspage.py437
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/builder.py1475
-rw-r--r--bitbake/lib/bb/ui/crumbs/buildmanager.py455
-rw-r--r--bitbake/lib/bb/ui/crumbs/hig/__init__.py0
-rw-r--r--bitbake/lib/bb/ui/crumbs/hig/advancedsettingsdialog.py341
-rw-r--r--bitbake/lib/bb/ui/crumbs/hig/crumbsdialog.py44
-rw-r--r--bitbake/lib/bb/ui/crumbs/hig/crumbsmessagedialog.py70
-rw-r--r--bitbake/lib/bb/ui/crumbs/hig/deployimagedialog.py219
-rw-r--r--bitbake/lib/bb/ui/crumbs/hig/imageselectiondialog.py172
-rw-r--r--bitbake/lib/bb/ui/crumbs/hig/layerselectiondialog.py298
-rw-r--r--bitbake/lib/bb/ui/crumbs/hig/parsingwarningsdialog.py163
-rw-r--r--bitbake/lib/bb/ui/crumbs/hig/propertydialog.py437
-rw-r--r--bitbake/lib/bb/ui/crumbs/hig/proxydetailsdialog.py90
-rw-r--r--bitbake/lib/bb/ui/crumbs/hig/retrieveimagedialog.py51
-rw-r--r--bitbake/lib/bb/ui/crumbs/hig/saveimagedialog.py159
-rw-r--r--bitbake/lib/bb/ui/crumbs/hig/settingsuihelper.py122
-rw-r--r--bitbake/lib/bb/ui/crumbs/hig/simplesettingsdialog.py894
-rw-r--r--bitbake/lib/bb/ui/crumbs/hobcolor.py38
-rw-r--r--bitbake/lib/bb/ui/crumbs/hobeventhandler.py639
-rw-r--r--bitbake/lib/bb/ui/crumbs/hoblistmodel.py903
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/hobpages.py128
-rw-r--r--bitbake/lib/bb/ui/crumbs/hobwidget.py904
-rw-r--r--bitbake/lib/bb/ui/crumbs/imageconfigurationpage.py561
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/imagedetailspage.py669
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/packageselectionpage.py355
-rw-r--r--bitbake/lib/bb/ui/crumbs/persistenttooltip.py186
-rw-r--r--bitbake/lib/bb/ui/crumbs/progress.py23
-rw-r--r--bitbake/lib/bb/ui/crumbs/progressbar.py59
-rw-r--r--bitbake/lib/bb/ui/crumbs/puccho.glade606
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/recipeselectionpage.py335
-rw-r--r--bitbake/lib/bb/ui/crumbs/runningbuild.py551
-rw-r--r--bitbake/lib/bb/ui/crumbs/sanitycheckpage.py85
-rw-r--r--bitbake/lib/bb/ui/crumbs/utils.py34
-rw-r--r--bitbake/lib/bb/ui/depexp.py326
-rw-r--r--bitbake/lib/bb/ui/goggle.py121
-rwxr-xr-xbitbake/lib/bb/ui/hob.py109
-rw-r--r--bitbake/lib/bb/ui/icons/images/images_display.pngbin0 -> 6898 bytes
-rw-r--r--bitbake/lib/bb/ui/icons/images/images_hover.pngbin0 -> 7051 bytes
-rw-r--r--bitbake/lib/bb/ui/icons/indicators/add-hover.pngbin0 -> 1212 bytes
-rw-r--r--bitbake/lib/bb/ui/icons/indicators/add.pngbin0 -> 1176 bytes
-rw-r--r--bitbake/lib/bb/ui/icons/indicators/alert.pngbin0 -> 3954 bytes
-rw-r--r--bitbake/lib/bb/ui/icons/indicators/confirmation.pngbin0 -> 5789 bytes
-rw-r--r--bitbake/lib/bb/ui/icons/indicators/denied.pngbin0 -> 3955 bytes
-rw-r--r--bitbake/lib/bb/ui/icons/indicators/error.pngbin0 -> 6482 bytes
-rw-r--r--bitbake/lib/bb/ui/icons/indicators/info.pngbin0 -> 3311 bytes
-rw-r--r--bitbake/lib/bb/ui/icons/indicators/issues.pngbin0 -> 4549 bytes
-rw-r--r--bitbake/lib/bb/ui/icons/indicators/refresh.pngbin0 -> 5250 bytes
-rw-r--r--bitbake/lib/bb/ui/icons/indicators/remove-hover.pngbin0 -> 2809 bytes
-rw-r--r--bitbake/lib/bb/ui/icons/indicators/remove.pngbin0 -> 1971 bytes
-rw-r--r--bitbake/lib/bb/ui/icons/indicators/tick.pngbin0 -> 4563 bytes
-rw-r--r--bitbake/lib/bb/ui/icons/info/info_display.pngbin0 -> 4117 bytes
-rw-r--r--bitbake/lib/bb/ui/icons/info/info_hover.pngbin0 -> 4167 bytes
-rw-r--r--bitbake/lib/bb/ui/icons/layers/layers_display.pngbin0 -> 4840 bytes
-rw-r--r--bitbake/lib/bb/ui/icons/layers/layers_hover.pngbin0 -> 5257 bytes
-rw-r--r--bitbake/lib/bb/ui/icons/packages/packages_display.pngbin0 -> 7011 bytes
-rw-r--r--bitbake/lib/bb/ui/icons/packages/packages_hover.pngbin0 -> 7121 bytes
-rw-r--r--bitbake/lib/bb/ui/icons/recipe/recipe_display.pngbin0 -> 4723 bytes
-rw-r--r--bitbake/lib/bb/ui/icons/recipe/recipe_hover.pngbin0 -> 4866 bytes
-rw-r--r--bitbake/lib/bb/ui/icons/settings/settings_display.pngbin0 -> 6076 bytes
-rw-r--r--bitbake/lib/bb/ui/icons/settings/settings_hover.pngbin0 -> 6269 bytes
-rw-r--r--bitbake/lib/bb/ui/icons/templates/templates_display.pngbin0 -> 5651 bytes
-rw-r--r--bitbake/lib/bb/ui/icons/templates/templates_hover.pngbin0 -> 5791 bytes
-rw-r--r--bitbake/lib/bb/ui/knotty.py550
-rw-r--r--bitbake/lib/bb/ui/ncurses.py373
-rw-r--r--bitbake/lib/bb/ui/puccho.py425
-rw-r--r--bitbake/lib/bb/ui/toasterui.py292
-rw-r--r--bitbake/lib/bb/ui/uievent.py133
-rw-r--r--bitbake/lib/bb/ui/uihelper.py100
-rw-r--r--bitbake/lib/bb/utils.py878
-rw-r--r--bitbake/lib/codegen.py570
-rw-r--r--bitbake/lib/ply/__init__.py4
-rw-r--r--bitbake/lib/ply/lex.py1058
-rw-r--r--bitbake/lib/ply/yacc.py3276
-rw-r--r--bitbake/lib/progressbar.py384
-rw-r--r--bitbake/lib/prserv/__init__.py14
-rw-r--r--bitbake/lib/prserv/db.py242
-rw-r--r--bitbake/lib/prserv/serv.py370
-rw-r--r--bitbake/lib/toaster/__init__.py0
-rw-r--r--bitbake/lib/toaster/bldviewer/__init__.py0
-rw-r--r--bitbake/lib/toaster/bldviewer/api.py44
-rw-r--r--bitbake/lib/toaster/bldviewer/static/css/bootstrap.css4797
-rw-r--r--bitbake/lib/toaster/bldviewer/static/js/bootstrap.js1982
-rw-r--r--bitbake/lib/toaster/bldviewer/static/js/jquery-2.0.3.js6
-rw-r--r--bitbake/lib/toaster/bldviewer/templates/simple_base.html30
-rw-r--r--bitbake/lib/toaster/bldviewer/templates/simple_basebuildpage.html17
-rw-r--r--bitbake/lib/toaster/bldviewer/templates/simple_basetable.html64
-rw-r--r--bitbake/lib/toaster/bldviewer/templates/simple_bfile.html24
-rw-r--r--bitbake/lib/toaster/bldviewer/templates/simple_bpackage.html44
-rw-r--r--bitbake/lib/toaster/bldviewer/templates/simple_build.html43
-rw-r--r--bitbake/lib/toaster/bldviewer/templates/simple_configuration.html22
-rw-r--r--bitbake/lib/toaster/bldviewer/templates/simple_layer.html34
-rw-r--r--bitbake/lib/toaster/bldviewer/templates/simple_package.html36
-rw-r--r--bitbake/lib/toaster/bldviewer/templates/simple_recipe.html50
-rw-r--r--bitbake/lib/toaster/bldviewer/templates/simple_task.html71
-rw-r--r--bitbake/lib/toaster/bldviewer/templatetags/__init__.py0
-rw-r--r--bitbake/lib/toaster/bldviewer/templatetags/projecttags.py29
-rw-r--r--bitbake/lib/toaster/bldviewer/tests.py342
-rw-r--r--bitbake/lib/toaster/bldviewer/urls.py35
-rw-r--r--bitbake/lib/toaster/bldviewer/views.py287
-rwxr-xr-xbitbake/lib/toaster/manage.py10
-rw-r--r--bitbake/lib/toaster/orm/__init__.py0
-rw-r--r--bitbake/lib/toaster/orm/fixtures/orm_views_testdata.json140835
-rw-r--r--bitbake/lib/toaster/orm/migrations/0001_initial.py400
-rw-r--r--bitbake/lib/toaster/orm/migrations/0002_auto__add_field_build_timespent.py180
-rw-r--r--bitbake/lib/toaster/orm/migrations/0003_timespent.py182
-rw-r--r--bitbake/lib/toaster/orm/migrations/0004_auto__add_field_package_installed_name.py180
-rw-r--r--bitbake/lib/toaster/orm/migrations/0005_auto__add_target_image_file__add_target_file__add_field_variablehistor.py301
-rw-r--r--bitbake/lib/toaster/orm/migrations/0006_auto__add_field_target_image_size__add_field_target_license_manifest_p.py235
-rw-r--r--bitbake/lib/toaster/orm/migrations/0007_auto__add_helptext.py214
-rw-r--r--bitbake/lib/toaster/orm/migrations/__init__.py0
-rw-r--r--bitbake/lib/toaster/orm/models.py369
-rw-r--r--bitbake/lib/toaster/toastergui/__init__.py0
-rwxr-xr-xbitbake/lib/toaster/toastergui/static/css/bootstrap-responsive.min.css9
-rwxr-xr-xbitbake/lib/toaster/toastergui/static/css/bootstrap.min.css9
-rw-r--r--bitbake/lib/toaster/toastergui/static/css/default.css132
-rwxr-xr-xbitbake/lib/toaster/toastergui/static/css/font-awesome.min.css33
-rw-r--r--bitbake/lib/toaster/toastergui/static/css/jquery.treetable.css28
-rw-r--r--bitbake/lib/toaster/toastergui/static/css/jquery.treetable.theme.default.css64
-rw-r--r--bitbake/lib/toaster/toastergui/static/css/jquery.treetable.theme.toaster.css38
-rwxr-xr-xbitbake/lib/toaster/toastergui/static/css/prettify.css1
-rw-r--r--bitbake/lib/toaster/toastergui/static/css/screen.css28
-rw-r--r--bitbake/lib/toaster/toastergui/static/fonts/FontAwesome.otfbin0 -> 48748 bytes
-rw-r--r--bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.eotbin0 -> 25395 bytes
-rw-r--r--bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.svg284
-rw-r--r--bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.ttfbin0 -> 55096 bytes
-rw-r--r--bitbake/lib/toaster/toastergui/static/fonts/fontawesome-webfont.woffbin0 -> 29380 bytes
-rw-r--r--bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.eotbin0 -> 20290 bytes
-rw-r--r--bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.svg229
-rw-r--r--bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.ttfbin0 -> 41236 bytes
-rw-r--r--bitbake/lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.woffbin0 -> 23292 bytes
-rw-r--r--bitbake/lib/toaster/toastergui/static/img/logo.pngbin0 -> 3020 bytes
-rwxr-xr-xbitbake/lib/toaster/toastergui/static/img/toaster.pngbin0 -> 51986 bytes
-rw-r--r--bitbake/lib/toaster/toastergui/static/jquery-treetable-license/GPL-LICENSE.txt278
-rw-r--r--bitbake/lib/toaster/toastergui/static/jquery-treetable-license/MIT-LICENSE.txt20
-rw-r--r--bitbake/lib/toaster/toastergui/static/jquery-treetable-license/README.md20
-rw-r--r--bitbake/lib/toaster/toastergui/static/jquery.treetable.theme.toaster.css66
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/bootstrap.min.js7
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/jquery-2.0.3.min.js6
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/jquery-2.0.3.min.map1
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/jquery-ui.js15003
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/jquery.cookie.js117
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/jquery.treetable.js620
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/main.js111
-rwxr-xr-xbitbake/lib/toaster/toastergui/static/js/prettify.js28
-rw-r--r--bitbake/lib/toaster/toastergui/templates/base.html74
-rwxr-xr-xbitbake/lib/toaster/toastergui/templates/basebuilddetailpage.html28
-rw-r--r--bitbake/lib/toaster/toastergui/templates/basebuildpage.html80
-rw-r--r--bitbake/lib/toaster/toastergui/templates/basetable_bottom.html85
-rw-r--r--bitbake/lib/toaster/toastergui/templates/basetable_top.html87
-rw-r--r--bitbake/lib/toaster/toastergui/templates/bfile.html24
-rw-r--r--bitbake/lib/toaster/toastergui/templates/bpackage.html108
-rw-r--r--bitbake/lib/toaster/toastergui/templates/build.html140
-rw-r--r--bitbake/lib/toaster/toastergui/templates/builddashboard.html198
-rw-r--r--bitbake/lib/toaster/toastergui/templates/buildtime.html4
-rw-r--r--bitbake/lib/toaster/toastergui/templates/configuration.html73
-rw-r--r--bitbake/lib/toaster/toastergui/templates/configvars.html130
-rw-r--r--bitbake/lib/toaster/toastergui/templates/cpuusage.html4
-rw-r--r--bitbake/lib/toaster/toastergui/templates/dirinfo.html237
-rw-r--r--bitbake/lib/toaster/toastergui/templates/diskio.html4
-rw-r--r--bitbake/lib/toaster/toastergui/templates/filtersnippet.html39
-rw-r--r--bitbake/lib/toaster/toastergui/templates/layer.html34
-rw-r--r--bitbake/lib/toaster/toastergui/templates/package.html36
-rw-r--r--bitbake/lib/toaster/toastergui/templates/package_built_dependencies.html99
-rw-r--r--bitbake/lib/toaster/toastergui/templates/package_built_detail.html65
-rw-r--r--bitbake/lib/toaster/toastergui/templates/package_detail_base.html145
-rw-r--r--bitbake/lib/toaster/toastergui/templates/package_included_dependencies.html110
-rw-r--r--bitbake/lib/toaster/toastergui/templates/package_included_detail.html44
-rw-r--r--bitbake/lib/toaster/toastergui/templates/package_included_reverse_dependencies.html50
-rw-r--r--bitbake/lib/toaster/toastergui/templates/package_included_tabs.html33
-rw-r--r--bitbake/lib/toaster/toastergui/templates/recipe.html273
-rwxr-xr-xbitbake/lib/toaster/toastergui/templates/recipes.html102
-rw-r--r--bitbake/lib/toaster/toastergui/templates/tablesort.html38
-rw-r--r--bitbake/lib/toaster/toastergui/templates/target.html163
-rw-r--r--bitbake/lib/toaster/toastergui/templates/task.html283
-rw-r--r--bitbake/lib/toaster/toastergui/templates/tasks.html133
-rw-r--r--bitbake/lib/toaster/toastergui/templatetags/__init__.py0
-rw-r--r--bitbake/lib/toaster/toastergui/templatetags/projecttags.py255
-rw-r--r--bitbake/lib/toaster/toastergui/urls.py69
-rw-r--r--bitbake/lib/toaster/toastergui/views.py1645
-rw-r--r--bitbake/lib/toaster/toastermain/__init__.py0
-rw-r--r--bitbake/lib/toaster/toastermain/management/__init__.py0
-rw-r--r--bitbake/lib/toaster/toastermain/management/commands/__init__.py0
-rw-r--r--bitbake/lib/toaster/toastermain/management/commands/builddelete.py33
-rw-r--r--bitbake/lib/toaster/toastermain/management/commands/buildslist.py13
-rw-r--r--bitbake/lib/toaster/toastermain/settings.py231
-rw-r--r--bitbake/lib/toaster/toastermain/urls.py44
-rw-r--r--bitbake/lib/toaster/toastermain/wsgi.py35
306 files changed, 232667 insertions, 0 deletions
diff --git a/bitbake/AUTHORS b/bitbake/AUTHORS
new file mode 100644
index 0000000..91fd78f
--- /dev/null
+++ b/bitbake/AUTHORS
@@ -0,0 +1,10 @@
1Tim Ansell <mithro@mithis.net>
2Phil Blundell <pb@handhelds.org>
3Seb Frankengul <seb@frankengul.org>
4Holger Freyther <holger@moiji-mobile.com>
5Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>
6Chris Larson <kergoth@handhelds.org>
7Ulrich Luckas <luckas@musoft.de>
8Mickey Lauer <mickey@Vanille.de>
9Richard Purdie <rpurdie@rpsys.net>
10Holger Schurig <holgerschurig@gmx.de>
diff --git a/bitbake/COPYING b/bitbake/COPYING
new file mode 100644
index 0000000..d511905
--- /dev/null
+++ b/bitbake/COPYING
@@ -0,0 +1,339 @@
1 GNU GENERAL PUBLIC LICENSE
2 Version 2, June 1991
3
4 Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 Everyone is permitted to copy and distribute verbatim copies
7 of this license document, but changing it is not allowed.
8
9 Preamble
10
11 The licenses for most software are designed to take away your
12freedom to share and change it. By contrast, the GNU General Public
13License is intended to guarantee your freedom to share and change free
14software--to make sure the software is free for all its users. This
15General Public License applies to most of the Free Software
16Foundation's software and to any other program whose authors commit to
17using it. (Some other Free Software Foundation software is covered by
18the GNU Lesser General Public License instead.) You can apply it to
19your programs, too.
20
21 When we speak of free software, we are referring to freedom, not
22price. Our General Public Licenses are designed to make sure that you
23have the freedom to distribute copies of free software (and charge for
24this service if you wish), that you receive source code or can get it
25if you want it, that you can change the software or use pieces of it
26in new free programs; and that you know you can do these things.
27
28 To protect your rights, we need to make restrictions that forbid
29anyone to deny you these rights or to ask you to surrender the rights.
30These restrictions translate to certain responsibilities for you if you
31distribute copies of the software, or if you modify it.
32
33 For example, if you distribute copies of such a program, whether
34gratis or for a fee, you must give the recipients all the rights that
35you have. You must make sure that they, too, receive or can get the
36source code. And you must show them these terms so they know their
37rights.
38
39 We protect your rights with two steps: (1) copyright the software, and
40(2) offer you this license which gives you legal permission to copy,
41distribute and/or modify the software.
42
43 Also, for each author's protection and ours, we want to make certain
44that everyone understands that there is no warranty for this free
45software. If the software is modified by someone else and passed on, we
46want its recipients to know that what they have is not the original, so
47that any problems introduced by others will not reflect on the original
48authors' reputations.
49
50 Finally, any free program is threatened constantly by software
51patents. We wish to avoid the danger that redistributors of a free
52program will individually obtain patent licenses, in effect making the
53program proprietary. To prevent this, we have made it clear that any
54patent must be licensed for everyone's free use or not licensed at all.
55
56 The precise terms and conditions for copying, distribution and
57modification follow.
58
59 GNU GENERAL PUBLIC LICENSE
60 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
62 0. This License applies to any program or other work which contains
63a notice placed by the copyright holder saying it may be distributed
64under the terms of this General Public License. The "Program", below,
65refers to any such program or work, and a "work based on the Program"
66means either the Program or any derivative work under copyright law:
67that is to say, a work containing the Program or a portion of it,
68either verbatim or with modifications and/or translated into another
69language. (Hereinafter, translation is included without limitation in
70the term "modification".) Each licensee is addressed as "you".
71
72Activities other than copying, distribution and modification are not
73covered by this License; they are outside its scope. The act of
74running the Program is not restricted, and the output from the Program
75is covered only if its contents constitute a work based on the
76Program (independent of having been made by running the Program).
77Whether that is true depends on what the Program does.
78
79 1. You may copy and distribute verbatim copies of the Program's
80source code as you receive it, in any medium, provided that you
81conspicuously and appropriately publish on each copy an appropriate
82copyright notice and disclaimer of warranty; keep intact all the
83notices that refer to this License and to the absence of any warranty;
84and give any other recipients of the Program a copy of this License
85along with the Program.
86
87You may charge a fee for the physical act of transferring a copy, and
88you may at your option offer warranty protection in exchange for a fee.
89
90 2. You may modify your copy or copies of the Program or any portion
91of it, thus forming a work based on the Program, and copy and
92distribute such modifications or work under the terms of Section 1
93above, provided that you also meet all of these conditions:
94
95 a) You must cause the modified files to carry prominent notices
96 stating that you changed the files and the date of any change.
97
98 b) You must cause any work that you distribute or publish, that in
99 whole or in part contains or is derived from the Program or any
100 part thereof, to be licensed as a whole at no charge to all third
101 parties under the terms of this License.
102
103 c) If the modified program normally reads commands interactively
104 when run, you must cause it, when started running for such
105 interactive use in the most ordinary way, to print or display an
106 announcement including an appropriate copyright notice and a
107 notice that there is no warranty (or else, saying that you provide
108 a warranty) and that users may redistribute the program under
109 these conditions, and telling the user how to view a copy of this
110 License. (Exception: if the Program itself is interactive but
111 does not normally print such an announcement, your work based on
112 the Program is not required to print an announcement.)
113
114These requirements apply to the modified work as a whole. If
115identifiable sections of that work are not derived from the Program,
116and can be reasonably considered independent and separate works in
117themselves, then this License, and its terms, do not apply to those
118sections when you distribute them as separate works. But when you
119distribute the same sections as part of a whole which is a work based
120on the Program, the distribution of the whole must be on the terms of
121this License, whose permissions for other licensees extend to the
122entire whole, and thus to each and every part regardless of who wrote it.
123
124Thus, it is not the intent of this section to claim rights or contest
125your rights to work written entirely by you; rather, the intent is to
126exercise the right to control the distribution of derivative or
127collective works based on the Program.
128
129In addition, mere aggregation of another work not based on the Program
130with the Program (or with a work based on the Program) on a volume of
131a storage or distribution medium does not bring the other work under
132the scope of this License.
133
134 3. You may copy and distribute the Program (or a work based on it,
135under Section 2) in object code or executable form under the terms of
136Sections 1 and 2 above provided that you also do one of the following:
137
138 a) Accompany it with the complete corresponding machine-readable
139 source code, which must be distributed under the terms of Sections
140 1 and 2 above on a medium customarily used for software interchange; or,
141
142 b) Accompany it with a written offer, valid for at least three
143 years, to give any third party, for a charge no more than your
144 cost of physically performing source distribution, a complete
145 machine-readable copy of the corresponding source code, to be
146 distributed under the terms of Sections 1 and 2 above on a medium
147 customarily used for software interchange; or,
148
149 c) Accompany it with the information you received as to the offer
150 to distribute corresponding source code. (This alternative is
151 allowed only for noncommercial distribution and only if you
152 received the program in object code or executable form with such
153 an offer, in accord with Subsection b above.)
154
155The source code for a work means the preferred form of the work for
156making modifications to it. For an executable work, complete source
157code means all the source code for all modules it contains, plus any
158associated interface definition files, plus the scripts used to
159control compilation and installation of the executable. However, as a
160special exception, the source code distributed need not include
161anything that is normally distributed (in either source or binary
162form) with the major components (compiler, kernel, and so on) of the
163operating system on which the executable runs, unless that component
164itself accompanies the executable.
165
166If distribution of executable or object code is made by offering
167access to copy from a designated place, then offering equivalent
168access to copy the source code from the same place counts as
169distribution of the source code, even though third parties are not
170compelled to copy the source along with the object code.
171
172 4. You may not copy, modify, sublicense, or distribute the Program
173except as expressly provided under this License. Any attempt
174otherwise to copy, modify, sublicense or distribute the Program is
175void, and will automatically terminate your rights under this License.
176However, parties who have received copies, or rights, from you under
177this License will not have their licenses terminated so long as such
178parties remain in full compliance.
179
180 5. You are not required to accept this License, since you have not
181signed it. However, nothing else grants you permission to modify or
182distribute the Program or its derivative works. These actions are
183prohibited by law if you do not accept this License. Therefore, by
184modifying or distributing the Program (or any work based on the
185Program), you indicate your acceptance of this License to do so, and
186all its terms and conditions for copying, distributing or modifying
187the Program or works based on it.
188
189 6. Each time you redistribute the Program (or any work based on the
190Program), the recipient automatically receives a license from the
191original licensor to copy, distribute or modify the Program subject to
192these terms and conditions. You may not impose any further
193restrictions on the recipients' exercise of the rights granted herein.
194You are not responsible for enforcing compliance by third parties to
195this License.
196
197 7. If, as a consequence of a court judgment or allegation of patent
198infringement or for any other reason (not limited to patent issues),
199conditions are imposed on you (whether by court order, agreement or
200otherwise) that contradict the conditions of this License, they do not
201excuse you from the conditions of this License. If you cannot
202distribute so as to satisfy simultaneously your obligations under this
203License and any other pertinent obligations, then as a consequence you
204may not distribute the Program at all. For example, if a patent
205license would not permit royalty-free redistribution of the Program by
206all those who receive copies directly or indirectly through you, then
207the only way you could satisfy both it and this License would be to
208refrain entirely from distribution of the Program.
209
210If any portion of this section is held invalid or unenforceable under
211any particular circumstance, the balance of the section is intended to
212apply and the section as a whole is intended to apply in other
213circumstances.
214
215It is not the purpose of this section to induce you to infringe any
216patents or other property right claims or to contest validity of any
217such claims; this section has the sole purpose of protecting the
218integrity of the free software distribution system, which is
219implemented by public license practices. Many people have made
220generous contributions to the wide range of software distributed
221through that system in reliance on consistent application of that
222system; it is up to the author/donor to decide if he or she is willing
223to distribute software through any other system and a licensee cannot
224impose that choice.
225
226This section is intended to make thoroughly clear what is believed to
227be a consequence of the rest of this License.
228
229 8. If the distribution and/or use of the Program is restricted in
230certain countries either by patents or by copyrighted interfaces, the
231original copyright holder who places the Program under this License
232may add an explicit geographical distribution limitation excluding
233those countries, so that distribution is permitted only in or among
234countries not thus excluded. In such case, this License incorporates
235the limitation as if written in the body of this License.
236
237 9. The Free Software Foundation may publish revised and/or new versions
238of the General Public License from time to time. Such new versions will
239be similar in spirit to the present version, but may differ in detail to
240address new problems or concerns.
241
242Each version is given a distinguishing version number. If the Program
243specifies a version number of this License which applies to it and "any
244later version", you have the option of following the terms and conditions
245either of that version or of any later version published by the Free
246Software Foundation. If the Program does not specify a version number of
247this License, you may choose any version ever published by the Free Software
248Foundation.
249
250 10. If you wish to incorporate parts of the Program into other free
251programs whose distribution conditions are different, write to the author
252to ask for permission. For software which is copyrighted by the Free
253Software Foundation, write to the Free Software Foundation; we sometimes
254make exceptions for this. Our decision will be guided by the two goals
255of preserving the free status of all derivatives of our free software and
256of promoting the sharing and reuse of software generally.
257
258 NO WARRANTY
259
260 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268REPAIR OR CORRECTION.
269
270 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278POSSIBILITY OF SUCH DAMAGES.
279
280 END OF TERMS AND CONDITIONS
281
282 How to Apply These Terms to Your New Programs
283
284 If you develop a new program, and you want it to be of the greatest
285possible use to the public, the best way to achieve this is to make it
286free software which everyone can redistribute and change under these terms.
287
288 To do so, attach the following notices to the program. It is safest
289to attach them to the start of each source file to most effectively
290convey the exclusion of warranty; and each file should have at least
291the "copyright" line and a pointer to where the full notice is found.
292
293 <one line to give the program's name and a brief idea of what it does.>
294 Copyright (C) <year> <name of author>
295
296 This program is free software; you can redistribute it and/or modify
297 it under the terms of the GNU General Public License as published by
298 the Free Software Foundation; either version 2 of the License, or
299 (at your option) any later version.
300
301 This program is distributed in the hope that it will be useful,
302 but WITHOUT ANY WARRANTY; without even the implied warranty of
303 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 GNU General Public License for more details.
305
306 You should have received a copy of the GNU General Public License along
307 with this program; if not, write to the Free Software Foundation, Inc.,
308 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
310Also add information on how to contact you by electronic and paper mail.
311
312If the program is interactive, make it output a short notice like this
313when it starts in an interactive mode:
314
315 Gnomovision version 69, Copyright (C) year name of author
316 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317 This is free software, and you are welcome to redistribute it
318 under certain conditions; type `show c' for details.
319
320The hypothetical commands `show w' and `show c' should show the appropriate
321parts of the General Public License. Of course, the commands you use may
322be called something other than `show w' and `show c'; they could even be
323mouse-clicks or menu items--whatever suits your program.
324
325You should also get your employer (if you work as a programmer) or your
326school, if any, to sign a "copyright disclaimer" for the program, if
327necessary. Here is a sample; alter the names:
328
329 Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330 `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
332 <signature of Ty Coon>, 1 April 1989
333 Ty Coon, President of Vice
334
335This General Public License does not permit incorporating your program into
336proprietary programs. If your program is a subroutine library, you may
337consider it more useful to permit linking proprietary applications with the
338library. If this is what you want to do, use the GNU Lesser General
339Public License instead of this License.
diff --git a/bitbake/ChangeLog b/bitbake/ChangeLog
new file mode 100644
index 0000000..4ac2a64
--- /dev/null
+++ b/bitbake/ChangeLog
@@ -0,0 +1,317 @@
1Changes in Bitbake 1.9.x:
2 - Add PE (Package Epoch) support from Philipp Zabel (pH5)
3 - Treat python functions the same as shell functions for logging
4 - Use TMPDIR/anonfunc as a __anonfunc temp directory (T)
5 - Catch truncated cache file errors
6 - Allow operations other than assignment on flag variables
7 - Add code to handle inter-task dependencies
8 - Fix cache errors when generation dotGraphs
9 - Make sure __inherit_cache is updated before calling include() (from Michael Krelin)
10 - Fix bug when target was in ASSUME_PROVIDED (#2236)
11 - Raise ParseError for filenames with multiple underscores instead of infinitely looping (#2062)
12 - Fix invalid regexp in BBMASK error handling (missing import) (#1124)
13 - Promote certain warnings from debug to note 2 level
14 - Update manual
15 - Correctly redirect stdin when forking
16 - If parsing errors are found, exit, too many users miss the errors
17 - Remove supriours PREFERRED_PROVIDER warnings
18 - svn fetcher: Add _buildsvncommand function
19 - Improve certain error messages
20 - Rewrite svn fetcher to make adding extra operations easier
21 as part of future SRCDATE="now" fixes
22 (requires new FETCHCMD_svn definition in bitbake.conf)
23 - Change SVNDIR layout to be more unique (fixes #2644 and #2624)
24 - Add ConfigParsed Event after configuration parsing is complete
25 - Add SRCREV support for svn fetcher
26 - data.emit_var() - only call getVar if we need the variable
27 - Stop generating the A variable (seems to be legacy code)
28 - Make sure intertask depends get processed correcting in recursive depends
29 - Add pn-PN to overrides when evaluating PREFERRED_VERSION
30 - Improve the progress indicator by skipping tasks that have
31 already run before starting the build rather than during it
32 - Add profiling option (-P)
33 - Add BB_SRCREV_POLICY variable (clear or cache) to control SRCREV cache
34 - Add SRCREV_FORMAT support
35 - Fix local fetcher's localpath return values
36 - Apply OVERRIDES before performing immediate expansions
37 - Allow the -b -e option combination to take regular expressions
38 - Fix handling of variables with expansion in the name using _append/_prepend
39 e.g. RRECOMMENDS_${PN}_append_xyz = "abc"
40 - Add plain message function to bb.msg
41 - Sort the list of providers before processing so dependency problems are
42 reproducible rather than effectively random
43 - Fix/improve bitbake -s output
44 - Add locking for fetchers so only one tries to fetch a given file at a given time
45 - Fix int(0)/None confusion in runqueue.py which causes random gaps in dependency chains
46 - Expand data in addtasks
47 - Print the list of missing DEPENDS,RDEPENDS for the "No buildable providers available for required...."
48 error message.
49 - Rework add_task to be more efficient (6% speedup, 7% number of function calls reduction)
50 - Sort digraph output to make builds more reproducible
51 - Split expandKeys into two for loops to benefit from the expand_cache (12% speedup)
52 - runqueue.py: Fix idepends handling to avoid dependency errors
53 - Clear the terminal TOSTOP flag if set (and warn the user)
54 - Fix regression from r653 and make SRCDATE/CVSDATE work for packages again
55 - Fix a bug in bb.decodeurl where http://some.where.com/somefile.tgz decoded to host="" (#1530)
56 - Warn about malformed PREFERRED_PROVIDERS (#1072)
57 - Add support for BB_NICE_LEVEL option (#1627)
58 - Psyco is used only on x86 as there is no support for other architectures.
59 - Sort initial providers list by default preference (#1145, #2024)
60 - Improve provider sorting so prefered versions have preference over latest versions (#768)
61 - Detect builds of tasks with overlapping providers and warn (will become a fatal error) (#1359)
62 - Add MULTI_PROVIDER_WHITELIST variable to allow known safe multiple providers to be listed
63 - Handle paths in svn fetcher module parameter
64 - Support the syntax "export VARIABLE"
65 - Add bzr fetcher
66 - Add support for cleaning directories before a task in the form:
67 do_taskname[cleandirs] = "dir"
68 - bzr fetcher tweaks from Robert Schuster (#2913)
69 - Add mercurial (hg) fetcher from Robert Schuster (#2913)
70 - Don't add duplicates to BBPATH
71 - Fix preferred_version return values (providers.py)
72 - Fix 'depends' flag splitting
73 - Fix unexport handling (#3135)
74 - Add bb.copyfile function similar to bb.movefile (and improve movefile error reporting)
75 - Allow multiple options for deptask flag
76 - Use git-fetch instead of git-pull removing any need for merges when
77 fetching (we don't care about the index). Fixes fetch errors.
78 - Add BB_GENERATE_MIRROR_TARBALLS option, set to 0 to make git fetches
79 faster at the expense of not creating mirror tarballs.
80 - SRCREV handling updates, improvements and fixes from Poky
81 - Add bb.utils.lockfile() and bb.utils.unlockfile() from Poky
82 - Add support for task selfstamp and lockfiles flags
83 - Disable task number acceleration since it can allow the tasks to run
84 out of sequence
85 - Improve runqueue code comments
86 - Add task scheduler abstraction and some example schedulers
87 - Improve circular dependency chain debugging code and user feedback
88 - Don't give a stacktrace for invalid tasks, have a user friendly message (#3431)
89 - Add support for "-e target" (#3432)
90 - Fix shell showdata command (#3259)
91 - Fix shell data updating problems (#1880)
92 - Properly raise errors for invalid source URI protocols
93 - Change the wget fetcher failure handling to avoid lockfile problems
94 - Add support for branches in git fetcher (Otavio Salvador, Michael Lauer)
95 - Make taskdata and runqueue errors more user friendly
96 - Add norecurse and fullpath options to cvs fetcher
97 - Fix exit code for build failures in --continue mode
98 - Fix git branch tags fetching
99 - Change parseConfigurationFile so it works on real data, not a copy
100 - Handle 'base' inherit and all other INHERITs from parseConfigurationFile
101 instead of BBHandler
102 - Fix getVarFlags bug in data_smart
103 - Optmise cache handling by more quickly detecting an invalid cache, only
104 saving the cache when its changed, moving the cache validity check into
105 the parsing loop and factoring some getVar calls outside a for loop
106 - Cooker: Remove a debug message from the parsing loop to lower overhead
107 - Convert build.py exec_task to use getVarFlags
108 - Update shell to use cooker.buildFile
109 - Add StampUpdate event
110 - Convert -b option to use taskdata/runqueue
111 - Remove digraph and switch to new stamp checking code. exec_task no longer
112 honours dependencies
113 - Make fetcher timestamp updating non-fatal when permissions don't allow
114 updates
115 - Add BB_SCHEDULER variable/option ("completion" or "speed") controlling
116 the way bitbake schedules tasks
117 - Add BB_STAMP_POLICY variable/option ("perfile" or "full") controlling
118 how extensively stamps are looked at for validity
119 - When handling build target failures make sure idepends are checked and
120 failed where needed. Fixes --continue mode crashes.
121 - Fix -f (force) in conjunction with -b
122 - Fix problems with recrdeptask handling where some idepends weren't handled
123 correctly.
124 - Handle exit codes correctly (from pH5)
125 - Work around refs/HEAD issues with git over http (#3410)
126 - Add proxy support to the CVS fetcher (from Cyril Chemparathy)
127 - Improve runfetchcmd so errors are seen and various GIT variables are exported
128 - Add ability to fetchers to check URL validity without downloading
129 - Improve runtime PREFERRED_PROVIDERS warning message
130 - Add BB_STAMP_WHITELIST option which contains a list of stamps to ignore when
131 checking stamp dependencies and using a BB_STAMP_POLICY of "whitelist"
132 - No longer weight providers on the basis of a package being "already staged". This
133 leads to builds being non-deterministic.
134 - Flush stdout/stderr before forking to fix duplicate console output
135 - Make sure recrdeps tasks include all inter-task dependencies of a given fn
136 - Add bb.runqueue.check_stamp_fn() for use by packaged-staging
137 - Add PERSISTENT_DIR to store the PersistData in a persistent
138 directory != the cache dir.
139 - Add md5 and sha256 checksum generation functions to utils.py
140 - Correctly handle '-' characters in class names (#2958)
141 - Make sure expandKeys has been called on the data dictionary before running tasks
142 - Correctly add a task override in the form task-TASKNAME.
143 - Revert the '-' character fix in class names since it breaks things
144 - When a regexp fails to compile for PACKAGES_DYNAMIC, print a more useful error (#4444)
145 - Allow to checkout CVS by Date and Time. Just add HHmm to the SRCDATE.
146 - Move prunedir function to utils.py and add explode_dep_versions function
147 - Raise an exception if SRCREV == 'INVALID'
148 - Fix hg fetcher username/password handling and fix crash
149 - Fix PACKAGES_DYNAMIC handling of packages with '++' in the name
150 - Rename __depends to __base_depends after configuration parsing so we don't
151 recheck the validity of the config files time after time
152 - Add better environmental variable handling. By default it will now only pass certain
153 whitelisted variables into the data store. If BB_PRESERVE_ENV is set bitbake will use
154 all variable from the environment. If BB_ENV_WHITELIST is set, that whitelist will be
155 used instead of the internal bitbake one. Alternatively, BB_ENV_EXTRAWHITE can be used
156 to extend the internal whitelist.
157 - Perforce fetcher fix to use commandline options instead of being overriden by the environment
158 - bb.utils.prunedir can cope with symlinks to directoriees without exceptions
159 - use @rev when doing a svn checkout
160 - Add osc fetcher (from Joshua Lock in Poky)
161 - When SRCREV autorevisioning for a recipe is in use, don't cache the recipe
162 - Add tryaltconfigs option to control whether bitbake trys using alternative providers
163 to fulfil failed dependencies. It defaults to off, changing the default since this
164 behaviour confuses many users and isn't often useful.
165 - Improve lock file function error handling
166 - Add username handling to the git fetcher (Robert Bragg)
167 - Add support for HTTP_PROXY and HTTP_PROXY_IGNORE variables to the wget fetcher
168 - Export more variables to the fetcher commands to allow ssh checkouts and checkouts through
169 proxies to work better. (from Poky)
170 - Also allow user and pswd options in SRC_URIs globally (from Poky)
171 - Improve proxy handling when using mirrors (from Poky)
172 - Add bb.utils.prune_suffix function
173 - Fix hg checkouts of specific revisions (from Poky)
174 - Fix wget fetching of urls with parameters specified (from Poky)
175 - Add username handling to git fetcher (from Poky)
176 - Set HOME environmental variable when running fetcher commands (from Poky)
177 - Make sure allowed variables inherited from the environment are exported again (from Poky)
178 - When running a stage task in bbshell, run populate_staging, not the stage task (from Poky)
179 - Fix + character escaping from PACKAGES_DYNAMIC (thanks Otavio Salvador)
180 - Addition of BBCLASSEXTEND support for allowing one recipe to provide multiple targets (from Poky)
181
182Changes in Bitbake 1.8.0:
183 - Release 1.7.x as a stable series
184
185Changes in BitBake 1.7.x:
186 - Major updates of the dependency handling and execution
187 of tasks. Code from bin/bitbake replaced with runqueue.py
188 and taskdata.py
189 - New task execution code supports multithreading with a simplistic
190 threading algorithm controlled by BB_NUMBER_THREADS
191 - Change of the SVN Fetcher to keep the checkout around
192 courtsey of Paul Sokolovsky (#1367)
193 - PATH fix to bbimage (#1108)
194 - Allow debug domains to be specified on the commandline (-l)
195 - Allow 'interactive' tasks
196 - Logging message improvements
197 - Drop now uneeded BUILD_ALL_DEPS variable
198 - Add support for wildcards to -b option
199 - Major overhaul of the fetchers making a large amount of code common
200 including mirroring code
201 - Fetchers now touch md5 stamps upon access (to show activity)
202 - Fix -f force option when used without -b (long standing bug)
203 - Add expand_cache to data_cache.py, caching expanded data (speedup)
204 - Allow version field in DEPENDS (ignored for now)
205 - Add abort flag support to the shell
206 - Make inherit fail if the class doesn't exist (#1478)
207 - Fix data.emit_env() to expand keynames as well as values
208 - Add ssh fetcher
209 - Add perforce fetcher
210 - Make PREFERRED_PROVIDER_foobar defaults to foobar if available
211 - Share the parser's mtime_cache, reducing the number of stat syscalls
212 - Compile all anonfuncs at once!
213 *** Anonfuncs must now use common spacing format ***
214 - Memorise the list of handlers in __BBHANDLERS and tasks in __BBTASKS
215 This removes 2 million function calls resulting in a 5-10% speedup
216 - Add manpage
217 - Update generateDotGraph to use taskData/runQueue improving accuracy
218 and also adding a task dependency graph
219 - Fix/standardise on GPLv2 licence
220 - Move most functionality from bin/bitbake to cooker.py and split into
221 separate funcitons
222 - CVS fetcher: Added support for non-default port
223 - Add BBINCLUDELOGS_LINES, the number of lines to read from any logfile
224 - Drop shebangs from lib/bb scripts
225
226Changes in Bitbake 1.6.0:
227 - Better msg handling
228 - COW dict implementation from Tim Ansell (mithro) leading
229 to better performance
230 - Speed up of -s
231
232Changes in Bitbake 1.4.4:
233 - SRCDATE now handling courtsey Justin Patrin
234 - #1017 fix to work with rm_work
235
236Changes in BitBake 1.4.2:
237 - Send logs to oe.pastebin.com instead of pastebin.com
238 fixes #856
239 - Copy the internal bitbake data before building the
240 dependency graph. This fixes nano not having a
241 virtual/libc dependency
242 - Allow multiple TARBALL_STASH entries
243 - Cache, check if the directory exists before changing
244 into it
245 - git speedup cloning by not doing a checkout
246 - allow to have spaces in filenames (.conf, .bb, .bbclass)
247
248Changes in BitBake 1.4.0:
249 - Fix to check both RDEPENDS and RDEPENDS_${PN}
250 - Fix a RDEPENDS parsing bug in utils:explode_deps()
251 - Update git fetcher behaviour to match git changes
252 - ASSUME_PROVIDED allowed to include runtime packages
253 - git fetcher cleanup and efficency improvements
254 - Change the format of the cache
255 - Update usermanual to document the Fetchers
256 - Major changes to caching with a new strategy
257 giving a major performance increase when reparsing
258 with few data changes
259
260Changes in BitBake 1.3.3:
261 - Create a new Fetcher module to ease the
262 development of new Fetchers.
263 Issue #438 fixed by rpurdie@openedhand.com
264 - Make the Subversion fetcher honor the SRC Date
265 (CVSDATE).
266 Issue #555 fixed by chris@openedhand.com
267 - Expand PREFERRED_PROVIDER properly
268 Issue #436 fixed by rprudie@openedhand.com
269 - Typo fix for Issue #531 by Philipp Zabel for the
270 BitBake Shell
271 - Introduce a new special variable SRCDATE as
272 a generic naming to replace CVSDATE.
273 - Introduce a new keyword 'required'. In contrast
274 to 'include' parsing will fail if a to be included
275 file can not be found.
276 - Remove hardcoding of the STAMP directory. Patch
277 courtsey pHilipp Zabel
278 - Track the RDEPENDS of each package (rpurdie@openedhand.com)
279 - Introduce BUILD_ALL_DEPS to build all RDEPENDS. E.g
280 this is used by the OpenEmbedded Meta Packages.
281 (rpurdie@openedhand.com).
282
283Changes in BitBake 1.3.2:
284 - reintegration of make.py into BitBake
285 - bbread is gone, use bitbake -e
286 - lots of shell updates and bugfixes
287 - Introduction of the .= and =. operator
288 - Sort variables, keys and groups in bitdoc
289 - Fix regression in the handling of BBCOLLECTIONS
290 - Update the bitbake usermanual
291
292Changes in BitBake 1.3.0:
293 - add bitbake interactive shell (bitbake -i)
294 - refactor bitbake utility in OO style
295 - kill default arguments in methods in the bb.data module
296 - kill default arguments in methods in the bb.fetch module
297 - the http/https/ftp fetcher will fail if the to be
298 downloaded file was not found in DL_DIR (this is needed
299 to avoid unpacking the sourceforge mirror page)
300 - Switch to a cow like data instance for persistent and non
301 persisting mode (called data_smart.py)
302 - Changed the callback of bb.make.collect_bbfiles to carry
303 additional parameters
304 - Drastically reduced the amount of needed RAM by not holding
305 each data instance in memory when using a cache/persistent
306 storage
307
308Changes in BitBake 1.2.1:
309 The 1.2.1 release is meant as a intermediate release to lay the
310 ground for more radical changes. The most notable changes are:
311
312 - Do not hardcode {}, use bb.data.init() instead if you want to
313 get a instance of a data class
314 - bb.data.init() is a factory and the old bb.data methods are delegates
315 - Do not use deepcopy use bb.data.createCopy() instead.
316 - Removed default arguments in bb.fetch
317
diff --git a/bitbake/HEADER b/bitbake/HEADER
new file mode 100644
index 0000000..9859255
--- /dev/null
+++ b/bitbake/HEADER
@@ -0,0 +1,19 @@
1# ex:ts=4:sw=4:sts=4:et
2# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
3#
4# <one line to give the program's name and a brief idea of what it does.>
5# Copyright (C) <year> <name of author>
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License version 2 as
9# published by the Free Software Foundation.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License along
17# with this program; if not, write to the Free Software Foundation, Inc.,
18# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
diff --git a/bitbake/LICENSE b/bitbake/LICENSE
new file mode 100644
index 0000000..350140c
--- /dev/null
+++ b/bitbake/LICENSE
@@ -0,0 +1,10 @@
1BitBake is licensed under the GNU General Public License version 2.0. See COPYING for further details.
2
3The following external components are distributed with this software:
4
5* 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
6Foundation and individual contributors.
7
8* Twitter Bootstrap (including Glyphicons), redistributed under the Apache License 2.0.
9
10* jQuery is redistributed under the MIT license.
diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake
new file mode 100755
index 0000000..846d059
--- /dev/null
+++ b/bitbake/bin/bitbake
@@ -0,0 +1,362 @@
1#!/usr/bin/env python
2# ex:ts=4:sw=4:sts=4:et
3# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
4#
5# Copyright (C) 2003, 2004 Chris Larson
6# Copyright (C) 2003, 2004 Phil Blundell
7# Copyright (C) 2003 - 2005 Michael 'Mickey' Lauer
8# Copyright (C) 2005 Holger Hans Peter Freyther
9# Copyright (C) 2005 ROAD GmbH
10# Copyright (C) 2006 Richard Purdie
11#
12# This program is free software; you can redistribute it and/or modify
13# it under the terms of the GNU General Public License version 2 as
14# published by the Free Software Foundation.
15#
16# This program is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19# GNU General Public License for more details.
20#
21# You should have received a copy of the GNU General Public License along
22# with this program; if not, write to the Free Software Foundation, Inc.,
23# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24
25import os
26import sys, logging
27sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)),
28 'lib'))
29
30import optparse
31import warnings
32from traceback import format_exception
33try:
34 import bb
35except RuntimeError as exc:
36 sys.exit(str(exc))
37from bb import event
38import bb.msg
39from bb import cooker
40from bb import ui
41from bb import server
42from bb import cookerdata
43
44__version__ = "1.23.0"
45logger = logging.getLogger("BitBake")
46
47# Python multiprocessing requires /dev/shm
48if not os.access('/dev/shm', os.W_OK | os.X_OK):
49 sys.exit("FATAL: /dev/shm does not exist or is not writable")
50
51# Unbuffer stdout to avoid log truncation in the event
52# of an unorderly exit as well as to provide timely
53# updates to log files for use with tail
54try:
55 if sys.stdout.name == '<stdout>':
56 sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
57except:
58 pass
59
60
61def get_ui(config):
62 if not config.ui:
63 # modify 'ui' attribute because it is also read by cooker
64 config.ui = os.environ.get('BITBAKE_UI', 'knotty')
65
66 interface = config.ui
67
68 try:
69 # Dynamically load the UI based on the ui name. Although we
70 # suggest a fixed set this allows you to have flexibility in which
71 # ones are available.
72 module = __import__("bb.ui", fromlist = [interface])
73 return getattr(module, interface)
74 except AttributeError:
75 sys.exit("FATAL: Invalid user interface '%s' specified.\n"
76 "Valid interfaces: depexp, goggle, ncurses, hob, knotty [default]." % interface)
77
78
79# Display bitbake/OE warnings via the BitBake.Warnings logger, ignoring others"""
80warnlog = logging.getLogger("BitBake.Warnings")
81_warnings_showwarning = warnings.showwarning
82def _showwarning(message, category, filename, lineno, file=None, line=None):
83 if file is not None:
84 if _warnings_showwarning is not None:
85 _warnings_showwarning(message, category, filename, lineno, file, line)
86 else:
87 s = warnings.formatwarning(message, category, filename, lineno)
88 warnlog.warn(s)
89
90warnings.showwarning = _showwarning
91warnings.filterwarnings("ignore")
92warnings.filterwarnings("default", module="(<string>$|(oe|bb)\.)")
93warnings.filterwarnings("ignore", category=PendingDeprecationWarning)
94warnings.filterwarnings("ignore", category=ImportWarning)
95warnings.filterwarnings("ignore", category=DeprecationWarning, module="<string>$")
96warnings.filterwarnings("ignore", message="With-statements now directly support multiple context managers")
97
98class BitBakeConfigParameters(cookerdata.ConfigParameters):
99
100 def parseCommandLine(self):
101 parser = optparse.OptionParser(
102 version = "BitBake Build Tool Core version %s, %%prog version %s" % (bb.__version__, __version__),
103 usage = """%prog [options] [recipename/target ...]
104
105 Executes the specified task (default is 'build') for a given set of target recipes (.bb files).
106 It is assumed there is a conf/bblayers.conf available in cwd or in BBPATH which
107 will provide the layer, BBFILES and other configuration information.""")
108
109 parser.add_option("-b", "--buildfile", help = "Execute tasks from a specific .bb recipe directly. WARNING: Does not handle any dependencies from other recipes.",
110 action = "store", dest = "buildfile", default = None)
111
112 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.",
113 action = "store_false", dest = "abort", default = True)
114
115 parser.add_option("-a", "--tryaltconfigs", help = "Continue with builds by trying to use alternative providers where possible.",
116 action = "store_true", dest = "tryaltconfigs", default = False)
117
118 parser.add_option("-f", "--force", help = "Force the specified targets/task to run (invalidating any existing stamp file).",
119 action = "store_true", dest = "force", default = False)
120
121 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.",
122 action = "store", dest = "cmd")
123
124 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).",
125 action = "store", dest = "invalidate_stamp")
126
127 parser.add_option("-r", "--read", help = "Read the specified file before bitbake.conf.",
128 action = "append", dest = "prefile", default = [])
129
130 parser.add_option("-R", "--postread", help = "Read the specified file after bitbake.conf.",
131 action = "append", dest = "postfile", default = [])
132
133 parser.add_option("-v", "--verbose", help = "Output more log message data to the terminal.",
134 action = "store_true", dest = "verbose", default = False)
135
136 parser.add_option("-D", "--debug", help = "Increase the debug level. You can specify this more than once.",
137 action = "count", dest="debug", default = 0)
138
139 parser.add_option("-n", "--dry-run", help = "Don't execute, just go through the motions.",
140 action = "store_true", dest = "dry_run", default = False)
141
142 parser.add_option("-S", "--dump-signatures", help = "Dump out the signature construction information, with no task execution. Parameters are passed to the signature handling code, use 'none' if no specific handler is required.",
143 action = "append", dest = "dump_signatures", default = [])
144
145 parser.add_option("-p", "--parse-only", help = "Quit after parsing the BB recipes.",
146 action = "store_true", dest = "parse_only", default = False)
147
148 parser.add_option("-s", "--show-versions", help = "Show current and preferred versions of all recipes.",
149 action = "store_true", dest = "show_versions", default = False)
150
151 parser.add_option("-e", "--environment", help = "Show the global or per-package environment complete with information about where variables were set/changed.",
152 action = "store_true", dest = "show_environment", default = False)
153
154 parser.add_option("-g", "--graphviz", help = "Save dependency tree information for the specified targets in the dot syntax.",
155 action = "store_true", dest = "dot_graph", default = False)
156
157 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""",
158 action = "append", dest = "extra_assume_provided", default = [])
159
160 parser.add_option("-l", "--log-domains", help = """Show debug logging for the specified logging domains""",
161 action = "append", dest = "debug_domains", default = [])
162
163 parser.add_option("-P", "--profile", help = "Profile the command and save reports.",
164 action = "store_true", dest = "profile", default = False)
165
166 parser.add_option("-u", "--ui", help = "The user interface to use (e.g. knotty, hob, depexp).",
167 action = "store", dest = "ui")
168
169 parser.add_option("-t", "--servertype", help = "Choose which server to use, process or xmlrpc.",
170 action = "store", dest = "servertype")
171
172 parser.add_option("", "--revisions-changed", help = "Set the exit code depending on whether upstream floating revisions have changed or not.",
173 action = "store_true", dest = "revisions_changed", default = False)
174
175 parser.add_option("", "--server-only", help = "Run bitbake without a UI, only starting a server (cooker) process.",
176 action = "store_true", dest = "server_only", default = False)
177
178 parser.add_option("-B", "--bind", help = "The name/address for the bitbake server to bind to.",
179 action = "store", dest = "bind", default = False)
180
181 parser.add_option("", "--no-setscene", help = "Do not run any setscene tasks. sstate will be ignored and everything needed, built.",
182 action = "store_true", dest = "nosetscene", default = False)
183
184 parser.add_option("", "--remote-server", help = "Connect to the specified server.",
185 action = "store", dest = "remote_server", default = False)
186
187 parser.add_option("-m", "--kill-server", help = "Terminate the remote server.",
188 action = "store_true", dest = "kill_server", default = False)
189
190 parser.add_option("", "--observe-only", help = "Connect to a server as an observing-only client.",
191 action = "store_true", dest = "observe_only", default = False)
192
193 parser.add_option("", "--status-only", help = "Check the status of the remote bitbake server.",
194 action = "store_true", dest = "status_only", default = False)
195
196 options, targets = parser.parse_args(sys.argv)
197
198 # some environmental variables set also configuration options
199 if "BBSERVER" in os.environ:
200 options.servertype = "xmlrpc"
201 options.remote_server = os.environ["BBSERVER"]
202
203 return options, targets[1:]
204
205
206def start_server(servermodule, configParams, configuration, features):
207 server = servermodule.BitBakeServer()
208 if configParams.bind:
209 (host, port) = configParams.bind.split(':')
210 server.initServer((host, int(port)))
211 configuration.interface = [ server.serverImpl.host, server.serverImpl.port ]
212 else:
213 server.initServer()
214 configuration.interface = []
215
216 try:
217 configuration.setServerRegIdleCallback(server.getServerIdleCB())
218
219 cooker = bb.cooker.BBCooker(configuration, features)
220
221 server.addcooker(cooker)
222 server.saveConnectionDetails()
223 except Exception as e:
224 exc_info = sys.exc_info()
225 while hasattr(server, "event_queue"):
226 try:
227 import queue
228 except ImportError:
229 import Queue as queue
230 try:
231 event = server.event_queue.get(block=False)
232 except (queue.Empty, IOError):
233 break
234 if isinstance(event, logging.LogRecord):
235 logger.handle(event)
236 raise exc_info[1], None, exc_info[2]
237 server.detach()
238 return server
239
240
241
242def main():
243
244 configParams = BitBakeConfigParameters()
245 configuration = cookerdata.CookerConfiguration()
246 configuration.setConfigParameters(configParams)
247
248 ui_module = get_ui(configParams)
249
250 # Server type can be xmlrpc or process currently, if nothing is specified,
251 # the default server is process
252 if configParams.servertype:
253 server_type = configParams.servertype
254 else:
255 server_type = 'process'
256
257 try:
258 module = __import__("bb.server", fromlist = [server_type])
259 servermodule = getattr(module, server_type)
260 except AttributeError:
261 sys.exit("FATAL: Invalid server type '%s' specified.\n"
262 "Valid interfaces: xmlrpc, process [default]." % server_type)
263
264 if configParams.server_only:
265 if configParams.servertype != "xmlrpc":
266 sys.exit("FATAL: If '--server-only' is defined, we must set the servertype as 'xmlrpc'.\n")
267 if not configParams.bind:
268 sys.exit("FATAL: The '--server-only' option requires a name/address to bind to with the -B option.\n")
269 if configParams.remote_server:
270 sys.exit("FATAL: The '--server-only' option conflicts with %s.\n" %
271 ("the BBSERVER environment variable" if "BBSERVER" in os.environ else "the '--remote-server' option" ))
272
273 if configParams.bind and configParams.servertype != "xmlrpc":
274 sys.exit("FATAL: If '-B' or '--bind' is defined, we must set the servertype as 'xmlrpc'.\n")
275
276 if configParams.remote_server and configParams.servertype != "xmlrpc":
277 sys.exit("FATAL: If '--remote-server' is defined, we must set the servertype as 'xmlrpc'.\n")
278
279 if configParams.observe_only and (not configParams.remote_server or configParams.bind):
280 sys.exit("FATAL: '--observe-only' can only be used by UI clients connecting to a server.\n")
281
282 if "BBDEBUG" in os.environ:
283 level = int(os.environ["BBDEBUG"])
284 if level > configuration.debug:
285 configuration.debug = level
286
287 bb.msg.init_msgconfig(configParams.verbose, configuration.debug,
288 configuration.debug_domains)
289
290 # Ensure logging messages get sent to the UI as events
291 handler = bb.event.LogHandler()
292 if not configParams.status_only:
293 # In status only mode there are no logs and no UI
294 logger.addHandler(handler)
295
296 # Clear away any spurious environment variables while we stoke up the cooker
297 cleanedvars = bb.utils.clean_environment()
298
299 featureset = []
300 if not configParams.server_only:
301 # Collect the feature set for the UI
302 featureset = getattr(ui_module, "featureSet", [])
303
304 if not configParams.remote_server:
305 # we start a server with a given configuration
306 server = start_server(servermodule, configParams, configuration, featureset)
307 bb.event.ui_queue = []
308 else:
309 # we start a stub server that is actually a XMLRPClient that connects to a real server
310 server = servermodule.BitBakeXMLRPCClient(configParams.observe_only)
311 server.saveConnectionDetails(configParams.remote_server)
312 server.saveConnectionConfigParams(configParams)
313
314 if not configParams.server_only:
315 if configParams.status_only:
316 try:
317 server_connection = server.establishConnection(featureset)
318 except:
319 sys.exit(1)
320 if not server_connection:
321 sys.exit(1)
322 server_connection.terminate()
323 sys.exit(0)
324
325 # Setup a connection to the server (cooker)
326 server_connection = server.establishConnection(featureset)
327 if not server_connection:
328 if configParams.kill_server:
329 bb.fatal("Server already killed")
330 configParams.bind = configParams.remote_server
331 start_server(servermodule, configParams, configuration, featureset)
332 bb.event.ui_queue = []
333 server_connection = server.establishConnection(featureset)
334
335 # Restore the environment in case the UI needs it
336 for k in cleanedvars:
337 os.environ[k] = cleanedvars[k]
338
339 logger.removeHandler(handler)
340
341 try:
342 return ui_module.main(server_connection.connection, server_connection.events, configParams)
343 finally:
344 bb.event.ui_queue = []
345 server_connection.terminate()
346 else:
347 print("server address: %s, server port: %s" % (server.serverImpl.host, server.serverImpl.port))
348 return 0
349
350 return 1
351
352if __name__ == "__main__":
353 try:
354 ret = main()
355 except bb.BBHandledException:
356 ret = 1
357 except Exception:
358 ret = 1
359 import traceback
360 traceback.print_exc()
361 sys.exit(ret)
362
diff --git a/bitbake/bin/bitbake-diffsigs b/bitbake/bin/bitbake-diffsigs
new file mode 100755
index 0000000..78757b0
--- /dev/null
+++ b/bitbake/bin/bitbake-diffsigs
@@ -0,0 +1,122 @@
1#!/usr/bin/env python
2
3# bitbake-diffsigs
4# BitBake task signature data comparison utility
5#
6# Copyright (C) 2012-2013 Intel Corporation
7#
8# This program is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License version 2 as
10# published by the Free Software Foundation.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License along
18# with this program; if not, write to the Free Software Foundation, Inc.,
19# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
21import os
22import sys
23import warnings
24import fnmatch
25import optparse
26import logging
27
28sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib'))
29
30import bb.tinfoil
31import bb.siggen
32
33def logger_create(name, output=sys.stderr):
34 logger = logging.getLogger(name)
35 console = logging.StreamHandler(output)
36 format = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
37 if output.isatty():
38 format.enable_color()
39 console.setFormatter(format)
40 logger.addHandler(console)
41 logger.setLevel(logging.INFO)
42 return logger
43
44logger = logger_create('bitbake-diffsigs')
45
46def find_compare_task(bbhandler, pn, taskname):
47 """ Find the most recent signature files for the specified PN/task and compare them """
48
49 if not hasattr(bb.siggen, 'find_siginfo'):
50 logger.error('Metadata does not support finding signature data files')
51 sys.exit(1)
52
53 if not taskname.startswith('do_'):
54 taskname = 'do_%s' % taskname
55
56 filedates = bb.siggen.find_siginfo(pn, taskname, None, bbhandler.config_data)
57 latestfiles = sorted(filedates.keys(), key=lambda f: filedates[f])[-2:]
58 if not latestfiles:
59 logger.error('No sigdata files found matching %s %s' % (pn, taskname))
60 sys.exit(1)
61 elif len(latestfiles) < 2:
62 logger.error('Only one matching sigdata file found for the specified task (%s %s)' % (pn, taskname))
63 sys.exit(1)
64 else:
65 # Define recursion callback
66 def recursecb(key, hash1, hash2):
67 hashes = [hash1, hash2]
68 hashfiles = bb.siggen.find_siginfo(key, None, hashes, bbhandler.config_data)
69
70 recout = []
71 if len(hashfiles) == 2:
72 out2 = bb.siggen.compare_sigfiles(hashfiles[hash1], hashfiles[hash2], recursecb)
73 recout.extend(list(' ' + l for l in out2))
74 else:
75 recout.append("Unable to find matching sigdata for %s with hashes %s or %s" % (key, hash1, hash2))
76
77 return recout
78
79 # Recurse into signature comparison
80 output = bb.siggen.compare_sigfiles(latestfiles[0], latestfiles[1], recursecb)
81 if output:
82 print '\n'.join(output)
83 sys.exit(0)
84
85
86
87parser = optparse.OptionParser(
88 description = "Compares siginfo/sigdata files written out by BitBake",
89 usage = """
90 %prog -t recipename taskname
91 %prog sigdatafile1 sigdatafile2
92 %prog sigdatafile1""")
93
94parser.add_option("-t", "--task",
95 help = "find the signature data files for last two runs of the specified task and compare them",
96 action="store", dest="taskargs", nargs=2, metavar='recipename taskname')
97
98options, args = parser.parse_args(sys.argv)
99
100if options.taskargs:
101 tinfoil = bb.tinfoil.Tinfoil()
102 tinfoil.prepare(config_only = True)
103 find_compare_task(tinfoil, options.taskargs[0], options.taskargs[1])
104else:
105 if len(args) == 1:
106 parser.print_help()
107 else:
108 import cPickle
109 try:
110 if len(args) == 2:
111 output = bb.siggen.dump_sigfile(sys.argv[1])
112 else:
113 output = bb.siggen.compare_sigfiles(sys.argv[1], sys.argv[2])
114 except IOError as e:
115 logger.error(str(e))
116 sys.exit(1)
117 except cPickle.UnpicklingError, EOFError:
118 logger.error('Invalid signature data - ensure you are specifying sigdata/siginfo files')
119 sys.exit(1)
120
121 if output:
122 print '\n'.join(output)
diff --git a/bitbake/bin/bitbake-dumpsig b/bitbake/bin/bitbake-dumpsig
new file mode 100755
index 0000000..656d93a
--- /dev/null
+++ b/bitbake/bin/bitbake-dumpsig
@@ -0,0 +1,65 @@
1#!/usr/bin/env python
2
3# bitbake-dumpsig
4# BitBake task signature dump utility
5#
6# Copyright (C) 2013 Intel Corporation
7#
8# This program is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License version 2 as
10# published by the Free Software Foundation.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License along
18# with this program; if not, write to the Free Software Foundation, Inc.,
19# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
21import os
22import sys
23import warnings
24import optparse
25import logging
26
27sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib'))
28
29import bb.siggen
30
31def logger_create(name, output=sys.stderr):
32 logger = logging.getLogger(name)
33 console = logging.StreamHandler(output)
34 format = bb.msg.BBLogFormatter("%(levelname)s: %(message)s")
35 if output.isatty():
36 format.enable_color()
37 console.setFormatter(format)
38 logger.addHandler(console)
39 logger.setLevel(logging.INFO)
40 return logger
41
42logger = logger_create('bitbake-dumpsig')
43
44parser = optparse.OptionParser(
45 description = "Dumps siginfo/sigdata files written out by BitBake",
46 usage = """
47 %prog sigdatafile""")
48
49options, args = parser.parse_args(sys.argv)
50
51if len(args) == 1:
52 parser.print_help()
53else:
54 import cPickle
55 try:
56 output = bb.siggen.dump_sigfile(args[1])
57 except IOError as e:
58 logger.error(str(e))
59 sys.exit(1)
60 except cPickle.UnpicklingError, EOFError:
61 logger.error('Invalid signature data - ensure you are specifying a sigdata/siginfo file')
62 sys.exit(1)
63
64 if output:
65 print '\n'.join(output)
diff --git a/bitbake/bin/bitbake-layers b/bitbake/bin/bitbake-layers
new file mode 100755
index 0000000..2a7f829
--- /dev/null
+++ b/bitbake/bin/bitbake-layers
@@ -0,0 +1,726 @@
1#!/usr/bin/env python
2
3# This script has subcommands which operate against your bitbake layers, either
4# displaying useful information, or acting against them.
5# See the help output for details on available commands.
6
7# Copyright (C) 2011 Mentor Graphics Corporation
8# Copyright (C) 2012 Intel Corporation
9#
10# This program is free software; you can redistribute it and/or modify
11# it under the terms of the GNU General Public License version 2 as
12# published by the Free Software Foundation.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License along
20# with this program; if not, write to the Free Software Foundation, Inc.,
21# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22
23import cmd
24import logging
25import os
26import sys
27import fnmatch
28from collections import defaultdict
29import re
30
31bindir = os.path.dirname(__file__)
32topdir = os.path.dirname(bindir)
33sys.path[0:0] = [os.path.join(topdir, 'lib')]
34
35import bb.cache
36import bb.cooker
37import bb.providers
38import bb.utils
39import bb.tinfoil
40
41
42logger = logging.getLogger('BitBake')
43
44
45def main(args):
46 cmds = Commands()
47 if args:
48 # Allow user to specify e.g. show-layers instead of show_layers
49 args = [args[0].replace('-', '_')] + args[1:]
50 cmds.onecmd(' '.join(args))
51 else:
52 cmds.do_help('')
53 return cmds.returncode
54
55
56class Commands(cmd.Cmd):
57 def __init__(self):
58 self.bbhandler = None
59 self.returncode = 0
60 self.bblayers = []
61 cmd.Cmd.__init__(self)
62
63 def init_bbhandler(self, config_only = False):
64 if not self.bbhandler:
65 self.bbhandler = bb.tinfoil.Tinfoil()
66 self.bblayers = (self.bbhandler.config_data.getVar('BBLAYERS', True) or "").split()
67 self.bbhandler.prepare(config_only)
68
69 def default(self, line):
70 """Handle unrecognised commands"""
71 sys.stderr.write("Unrecognised command or option\n")
72 self.do_help('')
73
74 def do_help(self, topic):
75 """display general help or help on a specified command"""
76 if topic:
77 sys.stdout.write('%s: ' % topic)
78 cmd.Cmd.do_help(self, topic.replace('-', '_'))
79 else:
80 sys.stdout.write("usage: bitbake-layers <command> [arguments]\n\n")
81 sys.stdout.write("Available commands:\n")
82 procnames = list(set(self.get_names()))
83 for procname in procnames:
84 if procname[:3] == 'do_':
85 sys.stdout.write(" %s\n" % procname[3:].replace('_', '-'))
86 doc = getattr(self, procname).__doc__
87 if doc:
88 sys.stdout.write(" %s\n" % doc.splitlines()[0])
89
90 def do_show_layers(self, args):
91 """show current configured layers"""
92 self.init_bbhandler(config_only = True)
93 logger.plain("%s %s %s" % ("layer".ljust(20), "path".ljust(40), "priority"))
94 logger.plain('=' * 74)
95 for layerdir in self.bblayers:
96 layername = self.get_layer_name(layerdir)
97 layerpri = 0
98 for layer, _, regex, pri in self.bbhandler.cooker.recipecache.bbfile_config_priorities:
99 if regex.match(os.path.join(layerdir, 'test')):
100 layerpri = pri
101 break
102
103 logger.plain("%s %s %d" % (layername.ljust(20), layerdir.ljust(40), layerpri))
104
105
106 def version_str(self, pe, pv, pr = None):
107 verstr = "%s" % pv
108 if pr:
109 verstr = "%s-%s" % (verstr, pr)
110 if pe:
111 verstr = "%s:%s" % (pe, verstr)
112 return verstr
113
114
115 def do_show_overlayed(self, args):
116 """list overlayed recipes (where the same recipe exists in another layer)
117
118usage: show-overlayed [-f] [-s]
119
120Lists the names of overlayed recipes and the available versions in each
121layer, with the preferred version first. Note that skipped recipes that
122are overlayed will also be listed, with a " (skipped)" suffix.
123
124Options:
125 -f instead of the default formatting, list filenames of higher priority
126 recipes with the ones they overlay indented underneath
127 -s only list overlayed recipes where the version is the same
128"""
129 self.init_bbhandler()
130
131 show_filenames = False
132 show_same_ver_only = False
133 for arg in args.split():
134 if arg == '-f':
135 show_filenames = True
136 elif arg == '-s':
137 show_same_ver_only = True
138 else:
139 sys.stderr.write("show-overlayed: invalid option %s\n" % arg)
140 self.do_help('')
141 return
142
143 items_listed = self.list_recipes('Overlayed recipes', None, True, show_same_ver_only, show_filenames, True)
144
145 # Check for overlayed .bbclass files
146 classes = defaultdict(list)
147 for layerdir in self.bblayers:
148 classdir = os.path.join(layerdir, 'classes')
149 if os.path.exists(classdir):
150 for classfile in os.listdir(classdir):
151 if os.path.splitext(classfile)[1] == '.bbclass':
152 classes[classfile].append(classdir)
153
154 # Locating classes and other files is a bit more complicated than recipes -
155 # layer priority is not a factor; instead BitBake uses the first matching
156 # file in BBPATH, which is manipulated directly by each layer's
157 # conf/layer.conf in turn, thus the order of layers in bblayers.conf is a
158 # factor - however, each layer.conf is free to either prepend or append to
159 # BBPATH (or indeed do crazy stuff with it). Thus the order in BBPATH might
160 # not be exactly the order present in bblayers.conf either.
161 bbpath = str(self.bbhandler.config_data.getVar('BBPATH', True))
162 overlayed_class_found = False
163 for (classfile, classdirs) in classes.items():
164 if len(classdirs) > 1:
165 if not overlayed_class_found:
166 logger.plain('=== Overlayed classes ===')
167 overlayed_class_found = True
168
169 mainfile = bb.utils.which(bbpath, os.path.join('classes', classfile))
170 if show_filenames:
171 logger.plain('%s' % mainfile)
172 else:
173 # We effectively have to guess the layer here
174 logger.plain('%s:' % classfile)
175 mainlayername = '?'
176 for layerdir in self.bblayers:
177 classdir = os.path.join(layerdir, 'classes')
178 if mainfile.startswith(classdir):
179 mainlayername = self.get_layer_name(layerdir)
180 logger.plain(' %s' % mainlayername)
181 for classdir in classdirs:
182 fullpath = os.path.join(classdir, classfile)
183 if fullpath != mainfile:
184 if show_filenames:
185 print(' %s' % fullpath)
186 else:
187 print(' %s' % self.get_layer_name(os.path.dirname(classdir)))
188
189 if overlayed_class_found:
190 items_listed = True;
191
192 if not items_listed:
193 logger.plain('No overlayed files found.')
194
195
196 def do_show_recipes(self, args):
197 """list available recipes, showing the layer they are provided by
198
199usage: show-recipes [-f] [-m] [pnspec]
200
201Lists the names of overlayed recipes and the available versions in each
202layer, with the preferred version first. Optionally you may specify
203pnspec to match a specified recipe name (supports wildcards). Note that
204skipped recipes will also be listed, with a " (skipped)" suffix.
205
206Options:
207 -f instead of the default formatting, list filenames of higher priority
208 recipes with other available recipes indented underneath
209 -m only list where multiple recipes (in the same layer or different
210 layers) exist for the same recipe name
211"""
212 self.init_bbhandler()
213
214 show_filenames = False
215 show_multi_provider_only = False
216 pnspec = None
217 title = 'Available recipes:'
218 for arg in args.split():
219 if arg == '-f':
220 show_filenames = True
221 elif arg == '-m':
222 show_multi_provider_only = True
223 elif not arg.startswith('-'):
224 pnspec = arg
225 title = 'Available recipes matching %s:' % pnspec
226 else:
227 sys.stderr.write("show-recipes: invalid option %s\n" % arg)
228 self.do_help('')
229 return
230 self.list_recipes(title, pnspec, False, False, show_filenames, show_multi_provider_only)
231
232
233 def list_recipes(self, title, pnspec, show_overlayed_only, show_same_ver_only, show_filenames, show_multi_provider_only):
234 pkg_pn = self.bbhandler.cooker.recipecache.pkg_pn
235 (latest_versions, preferred_versions) = bb.providers.findProviders(self.bbhandler.config_data, self.bbhandler.cooker.recipecache, pkg_pn)
236 allproviders = bb.providers.allProviders(self.bbhandler.cooker.recipecache)
237
238 # Ensure we list skipped recipes
239 # We are largely guessing about PN, PV and the preferred version here,
240 # but we have no choice since skipped recipes are not fully parsed
241 skiplist = self.bbhandler.cooker.skiplist.keys()
242 skiplist.sort( key=lambda fileitem: self.bbhandler.cooker.collection.calc_bbfile_priority(fileitem) )
243 skiplist.reverse()
244 for fn in skiplist:
245 recipe_parts = os.path.splitext(os.path.basename(fn))[0].split('_')
246 p = recipe_parts[0]
247 if len(recipe_parts) > 1:
248 ver = (None, recipe_parts[1], None)
249 else:
250 ver = (None, 'unknown', None)
251 allproviders[p].append((ver, fn))
252 if not p in pkg_pn:
253 pkg_pn[p] = 'dummy'
254 preferred_versions[p] = (ver, fn)
255
256 def print_item(f, pn, ver, layer, ispref):
257 if f in skiplist:
258 skipped = ' (skipped)'
259 else:
260 skipped = ''
261 if show_filenames:
262 if ispref:
263 logger.plain("%s%s", f, skipped)
264 else:
265 logger.plain(" %s%s", f, skipped)
266 else:
267 if ispref:
268 logger.plain("%s:", pn)
269 logger.plain(" %s %s%s", layer.ljust(20), ver, skipped)
270
271 preffiles = []
272 items_listed = False
273 for p in sorted(pkg_pn):
274 if pnspec:
275 if not fnmatch.fnmatch(p, pnspec):
276 continue
277
278 if len(allproviders[p]) > 1 or not show_multi_provider_only:
279 pref = preferred_versions[p]
280 preffile = bb.cache.Cache.virtualfn2realfn(pref[1])[0]
281 if preffile not in preffiles:
282 preflayer = self.get_file_layer(preffile)
283 multilayer = False
284 same_ver = True
285 provs = []
286 for prov in allproviders[p]:
287 provfile = bb.cache.Cache.virtualfn2realfn(prov[1])[0]
288 provlayer = self.get_file_layer(provfile)
289 provs.append((provfile, provlayer, prov[0]))
290 if provlayer != preflayer:
291 multilayer = True
292 if prov[0] != pref[0]:
293 same_ver = False
294
295 if (multilayer or not show_overlayed_only) and (same_ver or not show_same_ver_only):
296 if not items_listed:
297 logger.plain('=== %s ===' % title)
298 items_listed = True
299 print_item(preffile, p, self.version_str(pref[0][0], pref[0][1]), preflayer, True)
300 for (provfile, provlayer, provver) in provs:
301 if provfile != preffile:
302 print_item(provfile, p, self.version_str(provver[0], provver[1]), provlayer, False)
303 # Ensure we don't show two entries for BBCLASSEXTENDed recipes
304 preffiles.append(preffile)
305
306 return items_listed
307
308
309 def do_flatten(self, args):
310 """flattens layer configuration into a separate output directory.
311
312usage: flatten [layer1 layer2 [layer3]...] <outputdir>
313
314Takes the specified layers (or all layers in the current layer
315configuration if none are specified) and builds a "flattened" directory
316containing the contents of all layers, with any overlayed recipes removed
317and bbappends appended to the corresponding recipes. Note that some manual
318cleanup may still be necessary afterwards, in particular:
319
320* where non-recipe files (such as patches) are overwritten (the flatten
321 command will show a warning for these)
322* where anything beyond the normal layer setup has been added to
323 layer.conf (only the lowest priority number layer's layer.conf is used)
324* overridden/appended items from bbappends will need to be tidied up
325* when the flattened layers do not have the same directory structure (the
326 flatten command should show a warning when this will cause a problem)
327
328Warning: if you flatten several layers where another layer is intended to
329be used "inbetween" them (in layer priority order) such that recipes /
330bbappends in the layers interact, and then attempt to use the new output
331layer together with that other layer, you may no longer get the same
332build results (as the layer priority order has effectively changed).
333"""
334 arglist = args.split()
335 if len(arglist) < 1:
336 logger.error('Please specify an output directory')
337 self.do_help('flatten')
338 return
339
340 if len(arglist) == 2:
341 logger.error('If you specify layers to flatten you must specify at least two')
342 self.do_help('flatten')
343 return
344
345 outputdir = arglist[-1]
346 if os.path.exists(outputdir) and os.listdir(outputdir):
347 logger.error('Directory %s exists and is non-empty, please clear it out first' % outputdir)
348 return
349
350 self.init_bbhandler()
351 layers = self.bblayers
352 if len(arglist) > 2:
353 layernames = arglist[:-1]
354 found_layernames = []
355 found_layerdirs = []
356 for layerdir in layers:
357 layername = self.get_layer_name(layerdir)
358 if layername in layernames:
359 found_layerdirs.append(layerdir)
360 found_layernames.append(layername)
361
362 for layername in layernames:
363 if not layername in found_layernames:
364 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])))
365 return
366 layers = found_layerdirs
367 else:
368 layernames = []
369
370 # Ensure a specified path matches our list of layers
371 def layer_path_match(path):
372 for layerdir in layers:
373 if path.startswith(os.path.join(layerdir, '')):
374 return layerdir
375 return None
376
377 appended_recipes = []
378 for layer in layers:
379 overlayed = []
380 for f in self.bbhandler.cooker.collection.overlayed.iterkeys():
381 for of in self.bbhandler.cooker.collection.overlayed[f]:
382 if of.startswith(layer):
383 overlayed.append(of)
384
385 logger.plain('Copying files from %s...' % layer )
386 for root, dirs, files in os.walk(layer):
387 for f1 in files:
388 f1full = os.sep.join([root, f1])
389 if f1full in overlayed:
390 logger.plain(' Skipping overlayed file %s' % f1full )
391 else:
392 ext = os.path.splitext(f1)[1]
393 if ext != '.bbappend':
394 fdest = f1full[len(layer):]
395 fdest = os.path.normpath(os.sep.join([outputdir,fdest]))
396 bb.utils.mkdirhier(os.path.dirname(fdest))
397 if os.path.exists(fdest):
398 if f1 == 'layer.conf' and root.endswith('/conf'):
399 logger.plain(' Skipping layer config file %s' % f1full )
400 continue
401 else:
402 logger.warn('Overwriting file %s', fdest)
403 bb.utils.copyfile(f1full, fdest)
404 if ext == '.bb':
405 if f1 in self.bbhandler.cooker.collection.appendlist:
406 appends = self.bbhandler.cooker.collection.appendlist[f1]
407 if appends:
408 logger.plain(' Applying appends to %s' % fdest )
409 for appendname in appends:
410 if layer_path_match(appendname):
411 self.apply_append(appendname, fdest)
412 appended_recipes.append(f1)
413
414 # Take care of when some layers are excluded and yet we have included bbappends for those recipes
415 for recipename in self.bbhandler.cooker.collection.appendlist.iterkeys():
416 if recipename not in appended_recipes:
417 appends = self.bbhandler.cooker.collection.appendlist[recipename]
418 first_append = None
419 for appendname in appends:
420 layer = layer_path_match(appendname)
421 if layer:
422 if first_append:
423 self.apply_append(appendname, first_append)
424 else:
425 fdest = appendname[len(layer):]
426 fdest = os.path.normpath(os.sep.join([outputdir,fdest]))
427 bb.utils.mkdirhier(os.path.dirname(fdest))
428 bb.utils.copyfile(appendname, fdest)
429 first_append = fdest
430
431 # Get the regex for the first layer in our list (which is where the conf/layer.conf file will
432 # have come from)
433 first_regex = None
434 layerdir = layers[0]
435 for layername, pattern, regex, _ in self.bbhandler.cooker.recipecache.bbfile_config_priorities:
436 if regex.match(os.path.join(layerdir, 'test')):
437 first_regex = regex
438 break
439
440 if first_regex:
441 # Find the BBFILES entries that match (which will have come from this conf/layer.conf file)
442 bbfiles = str(self.bbhandler.config_data.getVar('BBFILES', True)).split()
443 bbfiles_layer = []
444 for item in bbfiles:
445 if first_regex.match(item):
446 newpath = os.path.join(outputdir, item[len(layerdir)+1:])
447 bbfiles_layer.append(newpath)
448
449 if bbfiles_layer:
450 # Check that all important layer files match BBFILES
451 for root, dirs, files in os.walk(outputdir):
452 for f1 in files:
453 ext = os.path.splitext(f1)[1]
454 if ext in ['.bb', '.bbappend']:
455 f1full = os.sep.join([root, f1])
456 entry_found = False
457 for item in bbfiles_layer:
458 if fnmatch.fnmatch(f1full, item):
459 entry_found = True
460 break
461 if not entry_found:
462 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)
463
464 def get_file_layer(self, filename):
465 for layer, _, regex, _ in self.bbhandler.cooker.recipecache.bbfile_config_priorities:
466 if regex.match(filename):
467 for layerdir in self.bblayers:
468 if regex.match(os.path.join(layerdir, 'test')) and re.match(layerdir, filename):
469 return self.get_layer_name(layerdir)
470 return "?"
471
472 def get_file_layerdir(self, filename):
473 for layer, _, regex, _ in self.bbhandler.cooker.recipecache.bbfile_config_priorities:
474 if regex.match(filename):
475 for layerdir in self.bblayers:
476 if regex.match(os.path.join(layerdir, 'test')) and re.match(layerdir, filename):
477 return layerdir
478 return "?"
479
480 def remove_layer_prefix(self, f):
481 """Remove the layer_dir prefix, e.g., f = /path/to/layer_dir/foo/blah, the
482 return value will be: layer_dir/foo/blah"""
483 f_layerdir = self.get_file_layerdir(f)
484 prefix = os.path.join(os.path.dirname(f_layerdir), '')
485 return f[len(prefix):] if f.startswith(prefix) else f
486
487 def get_layer_name(self, layerdir):
488 return os.path.basename(layerdir.rstrip(os.sep))
489
490 def apply_append(self, appendname, recipename):
491 appendfile = open(appendname, 'r')
492 recipefile = open(recipename, 'a')
493 recipefile.write('\n')
494 recipefile.write('##### bbappended from %s #####\n' % self.get_file_layer(appendname))
495 recipefile.writelines(appendfile.readlines())
496 recipefile.close()
497 appendfile.close()
498
499 def do_show_appends(self, args):
500 """list bbappend files and recipe files they apply to
501
502usage: show-appends
503
504Recipes are listed with the bbappends that apply to them as subitems.
505"""
506 self.init_bbhandler()
507 if not self.bbhandler.cooker.collection.appendlist:
508 logger.plain('No append files found')
509 return
510
511 logger.plain('=== Appended recipes ===')
512
513 pnlist = list(self.bbhandler.cooker_data.pkg_pn.keys())
514 pnlist.sort()
515 for pn in pnlist:
516 self.show_appends_for_pn(pn)
517
518 self.show_appends_for_skipped()
519
520 def show_appends_for_pn(self, pn):
521 filenames = self.bbhandler.cooker_data.pkg_pn[pn]
522
523 best = bb.providers.findBestProvider(pn,
524 self.bbhandler.config_data,
525 self.bbhandler.cooker_data,
526 self.bbhandler.cooker_data.pkg_pn)
527 best_filename = os.path.basename(best[3])
528
529 self.show_appends_output(filenames, best_filename)
530
531 def show_appends_for_skipped(self):
532 filenames = [os.path.basename(f)
533 for f in self.bbhandler.cooker.skiplist.iterkeys()]
534 self.show_appends_output(filenames, None, " (skipped)")
535
536 def show_appends_output(self, filenames, best_filename, name_suffix = ''):
537 appended, missing = self.get_appends_for_files(filenames)
538 if appended:
539 for basename, appends in appended:
540 logger.plain('%s%s:', basename, name_suffix)
541 for append in appends:
542 logger.plain(' %s', append)
543
544 if best_filename:
545 if best_filename in missing:
546 logger.warn('%s: missing append for preferred version',
547 best_filename)
548 self.returncode |= 1
549
550
551 def get_appends_for_files(self, filenames):
552 appended, notappended = [], []
553 for filename in filenames:
554 _, cls = bb.cache.Cache.virtualfn2realfn(filename)
555 if cls:
556 continue
557
558 basename = os.path.basename(filename)
559 appends = self.bbhandler.cooker.collection.appendlist.get(basename)
560 if appends:
561 appended.append((basename, list(appends)))
562 else:
563 notappended.append(basename)
564 return appended, notappended
565
566 def do_show_cross_depends(self, args):
567 """figure out the dependency between recipes that crosses a layer boundary.
568
569usage: show-cross-depends [-f]
570
571Figure out the dependency between recipes that crosses a layer boundary.
572
573Options:
574 -f show full file path
575
576NOTE:
577The .bbappend file can impact the dependency.
578"""
579 self.init_bbhandler()
580
581 show_filenames = False
582 for arg in args.split():
583 if arg == '-f':
584 show_filenames = True
585 else:
586 sys.stderr.write("show-cross-depends: invalid option %s\n" % arg)
587 self.do_help('')
588 return
589
590 pkg_fn = self.bbhandler.cooker_data.pkg_fn
591 bbpath = str(self.bbhandler.config_data.getVar('BBPATH', True))
592 self.require_re = re.compile(r"require\s+(.+)")
593 self.include_re = re.compile(r"include\s+(.+)")
594 self.inherit_re = re.compile(r"inherit\s+(.+)")
595
596 # The bb's DEPENDS and RDEPENDS
597 for f in pkg_fn:
598 f = bb.cache.Cache.virtualfn2realfn(f)[0]
599 # Get the layername that the file is in
600 layername = self.get_file_layer(f)
601
602 # The DEPENDS
603 deps = self.bbhandler.cooker_data.deps[f]
604 for pn in deps:
605 if pn in self.bbhandler.cooker_data.pkg_pn:
606 best = bb.providers.findBestProvider(pn,
607 self.bbhandler.config_data,
608 self.bbhandler.cooker_data,
609 self.bbhandler.cooker_data.pkg_pn)
610 self.check_cross_depends("DEPENDS", layername, f, best[3], show_filenames)
611
612 # The RDPENDS
613 all_rdeps = self.bbhandler.cooker_data.rundeps[f].values()
614 # Remove the duplicated or null one.
615 sorted_rdeps = {}
616 # The all_rdeps is the list in list, so we need two for loops
617 for k1 in all_rdeps:
618 for k2 in k1:
619 sorted_rdeps[k2] = 1
620 all_rdeps = sorted_rdeps.keys()
621 for rdep in all_rdeps:
622 all_p = bb.providers.getRuntimeProviders(self.bbhandler.cooker_data, rdep)
623 if all_p:
624 best = bb.providers.filterProvidersRunTime(all_p, rdep,
625 self.bbhandler.config_data,
626 self.bbhandler.cooker_data)[0][0]
627 self.check_cross_depends("RDEPENDS", layername, f, best, show_filenames)
628
629 # The inherit class
630 cls_re = re.compile('classes/')
631 if f in self.bbhandler.cooker_data.inherits:
632 inherits = self.bbhandler.cooker_data.inherits[f]
633 for cls in inherits:
634 # The inherits' format is [classes/cls, /path/to/classes/cls]
635 # ignore the classes/cls.
636 if not cls_re.match(cls):
637 inherit_layername = self.get_file_layer(cls)
638 if inherit_layername != layername:
639 if not show_filenames:
640 f_short = self.remove_layer_prefix(f)
641 cls = self.remove_layer_prefix(cls)
642 else:
643 f_short = f
644 logger.plain("%s inherits %s" % (f_short, cls))
645
646 # The 'require/include xxx' in the bb file
647 pv_re = re.compile(r"\${PV}")
648 fnfile = open(f, 'r')
649 line = fnfile.readline()
650 while line:
651 m, keyword = self.match_require_include(line)
652 # Found the 'require/include xxxx'
653 if m:
654 needed_file = m.group(1)
655 # Replace the ${PV} with the real PV
656 if pv_re.search(needed_file) and f in self.bbhandler.cooker_data.pkg_pepvpr:
657 pv = self.bbhandler.cooker_data.pkg_pepvpr[f][1]
658 needed_file = re.sub(r"\${PV}", pv, needed_file)
659 self.print_cross_files(bbpath, keyword, layername, f, needed_file, show_filenames)
660 line = fnfile.readline()
661 fnfile.close()
662
663 # The "require/include xxx" in conf/machine/*.conf, .inc and .bbclass
664 conf_re = re.compile(".*/conf/machine/[^\/]*\.conf$")
665 inc_re = re.compile(".*\.inc$")
666 # The "inherit xxx" in .bbclass
667 bbclass_re = re.compile(".*\.bbclass$")
668 for layerdir in self.bblayers:
669 layername = self.get_layer_name(layerdir)
670 for dirpath, dirnames, filenames in os.walk(layerdir):
671 for name in filenames:
672 f = os.path.join(dirpath, name)
673 s = conf_re.match(f) or inc_re.match(f) or bbclass_re.match(f)
674 if s:
675 ffile = open(f, 'r')
676 line = ffile.readline()
677 while line:
678 m, keyword = self.match_require_include(line)
679 # Only bbclass has the "inherit xxx" here.
680 bbclass=""
681 if not m and f.endswith(".bbclass"):
682 m, keyword = self.match_inherit(line)
683 bbclass=".bbclass"
684 # Find a 'require/include xxxx'
685 if m:
686 self.print_cross_files(bbpath, keyword, layername, f, m.group(1) + bbclass, show_filenames)
687 line = ffile.readline()
688 ffile.close()
689
690 def print_cross_files(self, bbpath, keyword, layername, f, needed_filename, show_filenames):
691 """Print the depends that crosses a layer boundary"""
692 needed_file = bb.utils.which(bbpath, needed_filename)
693 if needed_file:
694 # Which layer is this file from
695 needed_layername = self.get_file_layer(needed_file)
696 if needed_layername != layername:
697 if not show_filenames:
698 f = self.remove_layer_prefix(f)
699 needed_file = self.remove_layer_prefix(needed_file)
700 logger.plain("%s %s %s" %(f, keyword, needed_file))
701 def match_inherit(self, line):
702 """Match the inherit xxx line"""
703 return (self.inherit_re.match(line), "inherits")
704
705 def match_require_include(self, line):
706 """Match the require/include xxx line"""
707 m = self.require_re.match(line)
708 keyword = "requires"
709 if not m:
710 m = self.include_re.match(line)
711 keyword = "includes"
712 return (m, keyword)
713
714 def check_cross_depends(self, keyword, layername, f, needed_file, show_filenames):
715 """Print the DEPENDS/RDEPENDS file that crosses a layer boundary"""
716 best_realfn = bb.cache.Cache.virtualfn2realfn(needed_file)[0]
717 needed_layername = self.get_file_layer(best_realfn)
718 if needed_layername != layername:
719 if not show_filenames:
720 f = self.remove_layer_prefix(f)
721 best_realfn = self.remove_layer_prefix(best_realfn)
722
723 logger.plain("%s %s %s" % (f, keyword, best_realfn))
724
725if __name__ == '__main__':
726 sys.exit(main(sys.argv[1:]) or 0)
diff --git a/bitbake/bin/bitbake-prserv b/bitbake/bin/bitbake-prserv
new file mode 100755
index 0000000..a8d7acb
--- /dev/null
+++ b/bitbake/bin/bitbake-prserv
@@ -0,0 +1,55 @@
1#!/usr/bin/env python
2import os
3import sys,logging
4import optparse
5
6sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)),'lib'))
7
8import prserv
9import prserv.serv
10
11__version__="1.0.0"
12
13PRHOST_DEFAULT='0.0.0.0'
14PRPORT_DEFAULT=8585
15
16def main():
17 parser = optparse.OptionParser(
18 version="Bitbake PR Service Core version %s, %%prog version %s" % (prserv.__version__, __version__),
19 usage = "%prog < --start | --stop > [options]")
20
21 parser.add_option("-f", "--file", help="database filename(default: prserv.sqlite3)", action="store",
22 dest="dbfile", type="string", default="prserv.sqlite3")
23 parser.add_option("-l", "--log", help="log filename(default: prserv.log)", action="store",
24 dest="logfile", type="string", default="prserv.log")
25 parser.add_option("--loglevel", help="logging level, i.e. CRITICAL, ERROR, WARNING, INFO, DEBUG",
26 action = "store", type="string", dest="loglevel", default = "INFO")
27 parser.add_option("--start", help="start daemon",
28 action="store_true", dest="start")
29 parser.add_option("--stop", help="stop daemon",
30 action="store_true", dest="stop")
31 parser.add_option("--host", help="ip address to bind", action="store",
32 dest="host", type="string", default=PRHOST_DEFAULT)
33 parser.add_option("--port", help="port number(default: 8585)", action="store",
34 dest="port", type="int", default=PRPORT_DEFAULT)
35
36 options, args = parser.parse_args(sys.argv)
37 prserv.init_logger(os.path.abspath(options.logfile),options.loglevel)
38
39 if options.start:
40 ret=prserv.serv.start_daemon(options.dbfile, options.host, options.port,os.path.abspath(options.logfile))
41 elif options.stop:
42 ret=prserv.serv.stop_daemon(options.host, options.port)
43 else:
44 ret=parser.print_help()
45 return ret
46
47if __name__ == "__main__":
48 try:
49 ret = main()
50 except Exception:
51 ret = 1
52 import traceback
53 traceback.print_exc(5)
54 sys.exit(ret)
55
diff --git a/bitbake/bin/bitbake-selftest b/bitbake/bin/bitbake-selftest
new file mode 100755
index 0000000..81e4c3c
--- /dev/null
+++ b/bitbake/bin/bitbake-selftest
@@ -0,0 +1,49 @@
1#!/usr/bin/env python
2#
3# Copyright (C) 2012 Richard Purdie
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License version 2 as
7# published by the Free Software Foundation.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License along
15# with this program; if not, write to the Free Software Foundation, Inc.,
16# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18import os
19import sys, logging
20sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)), 'lib'))
21
22import unittest
23try:
24 import bb
25except RuntimeError as exc:
26 sys.exit(str(exc))
27
28def usage():
29 print('usage: %s [testname1 [testname2]...]' % os.path.basename(sys.argv[0]))
30
31if len(sys.argv) > 1:
32 if '--help' in sys.argv[1:]:
33 usage()
34 sys.exit(0)
35
36 tests = sys.argv[1:]
37else:
38 tests = ["bb.tests.codeparser",
39 "bb.tests.cow",
40 "bb.tests.data",
41 "bb.tests.fetch",
42 "bb.tests.utils"]
43
44for t in tests:
45 t = '.'.join(t.split('.')[:3])
46 __import__(t)
47
48unittest.main(argv=["bitbake-selftest"] + tests)
49
diff --git a/bitbake/bin/bitbake-worker b/bitbake/bin/bitbake-worker
new file mode 100755
index 0000000..68e2bf4
--- /dev/null
+++ b/bitbake/bin/bitbake-worker
@@ -0,0 +1,375 @@
1#!/usr/bin/env python
2
3import os
4import sys
5import warnings
6sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(sys.argv[0])), 'lib'))
7from bb import fetch2
8import logging
9import bb
10import select
11import errno
12import signal
13
14# Users shouldn't be running this code directly
15if len(sys.argv) != 2 or sys.argv[1] != "decafbad":
16 print("bitbake-worker is meant for internal execution by bitbake itself, please don't use it standalone.")
17 sys.exit(1)
18
19logger = logging.getLogger("BitBake")
20
21try:
22 import cPickle as pickle
23except ImportError:
24 import pickle
25 bb.msg.note(1, bb.msg.domain.Cache, "Importing cPickle failed. Falling back to a very slow implementation.")
26
27
28worker_pipe = sys.stdout.fileno()
29bb.utils.nonblockingfd(worker_pipe)
30
31handler = bb.event.LogHandler()
32logger.addHandler(handler)
33
34if 0:
35 # Code to write out a log file of all events passing through the worker
36 logfilename = "/tmp/workerlogfile"
37 format_str = "%(levelname)s: %(message)s"
38 conlogformat = bb.msg.BBLogFormatter(format_str)
39 consolelog = logging.FileHandler(logfilename)
40 bb.msg.addDefaultlogFilter(consolelog)
41 consolelog.setFormatter(conlogformat)
42 logger.addHandler(consolelog)
43
44worker_queue = ""
45
46def worker_fire(event, d):
47 data = "<event>" + pickle.dumps(event) + "</event>"
48 worker_fire_prepickled(data)
49
50def worker_fire_prepickled(event):
51 global worker_queue
52
53 worker_queue = worker_queue + event
54 worker_flush()
55
56def worker_flush():
57 global worker_queue, worker_pipe
58
59 if not worker_queue:
60 return
61
62 try:
63 written = os.write(worker_pipe, worker_queue)
64 worker_queue = worker_queue[written:]
65 except (IOError, OSError) as e:
66 if e.errno != errno.EAGAIN:
67 raise
68
69def worker_child_fire(event, d):
70 global worker_pipe
71
72 data = "<event>" + pickle.dumps(event) + "</event>"
73 worker_pipe.write(data)
74
75bb.event.worker_fire = worker_fire
76
77lf = None
78#lf = open("/tmp/workercommandlog", "w+")
79def workerlog_write(msg):
80 if lf:
81 lf.write(msg)
82 lf.flush()
83
84def fork_off_task(cfg, data, workerdata, fn, task, taskname, appends, taskdepdata, quieterrors=False):
85 # We need to setup the environment BEFORE the fork, since
86 # a fork() or exec*() activates PSEUDO...
87
88 envbackup = {}
89 fakeenv = {}
90 umask = None
91
92 taskdep = workerdata["taskdeps"][fn]
93 if 'umask' in taskdep and taskname in taskdep['umask']:
94 # umask might come in as a number or text string..
95 try:
96 umask = int(taskdep['umask'][taskname],8)
97 except TypeError:
98 umask = taskdep['umask'][taskname]
99
100 # We can't use the fakeroot environment in a dry run as it possibly hasn't been built
101 if 'fakeroot' in taskdep and taskname in taskdep['fakeroot'] and not cfg.dry_run:
102 envvars = (workerdata["fakerootenv"][fn] or "").split()
103 for key, value in (var.split('=') for var in envvars):
104 envbackup[key] = os.environ.get(key)
105 os.environ[key] = value
106 fakeenv[key] = value
107
108 fakedirs = (workerdata["fakerootdirs"][fn] or "").split()
109 for p in fakedirs:
110 bb.utils.mkdirhier(p)
111 logger.debug(2, 'Running %s:%s under fakeroot, fakedirs: %s' %
112 (fn, taskname, ', '.join(fakedirs)))
113 else:
114 envvars = (workerdata["fakerootnoenv"][fn] or "").split()
115 for key, value in (var.split('=') for var in envvars):
116 envbackup[key] = os.environ.get(key)
117 os.environ[key] = value
118 fakeenv[key] = value
119
120 sys.stdout.flush()
121 sys.stderr.flush()
122
123 try:
124 pipein, pipeout = os.pipe()
125 pipein = os.fdopen(pipein, 'rb', 4096)
126 pipeout = os.fdopen(pipeout, 'wb', 0)
127 pid = os.fork()
128 except OSError as e:
129 bb.msg.fatal("RunQueue", "fork failed: %d (%s)" % (e.errno, e.strerror))
130
131 if pid == 0:
132 global worker_pipe
133 pipein.close()
134
135 signal.signal(signal.SIGTERM, signal.SIG_DFL)
136
137 # Save out the PID so that the event can include it the
138 # events
139 bb.event.worker_pid = os.getpid()
140 bb.event.worker_fire = worker_child_fire
141 worker_pipe = pipeout
142
143 # Make the child the process group leader
144 os.setpgid(0, 0)
145 # No stdin
146 newsi = os.open(os.devnull, os.O_RDWR)
147 os.dup2(newsi, sys.stdin.fileno())
148
149 if umask:
150 os.umask(umask)
151
152 data.setVar("BB_WORKERCONTEXT", "1")
153 data.setVar("BB_TASKDEPDATA", taskdepdata)
154 data.setVar("BUILDNAME", workerdata["buildname"])
155 data.setVar("DATE", workerdata["date"])
156 data.setVar("TIME", workerdata["time"])
157 bb.parse.siggen.set_taskdata(workerdata["hashes"], workerdata["hash_deps"], workerdata["sigchecksums"])
158 ret = 0
159 try:
160 the_data = bb.cache.Cache.loadDataFull(fn, appends, data)
161 the_data.setVar('BB_TASKHASH', workerdata["runq_hash"][task])
162 for h in workerdata["hashes"]:
163 the_data.setVar("BBHASH_%s" % h, workerdata["hashes"][h])
164 for h in workerdata["hash_deps"]:
165 the_data.setVar("BBHASHDEPS_%s" % h, workerdata["hash_deps"][h])
166
167 # exported_vars() returns a generator which *cannot* be passed to os.environ.update()
168 # successfully. We also need to unset anything from the environment which shouldn't be there
169 exports = bb.data.exported_vars(the_data)
170 bb.utils.empty_environment()
171 for e, v in exports:
172 os.environ[e] = v
173 for e in fakeenv:
174 os.environ[e] = fakeenv[e]
175 the_data.setVar(e, fakeenv[e])
176 the_data.setVarFlag(e, 'export', "1")
177
178 if quieterrors:
179 the_data.setVarFlag(taskname, "quieterrors", "1")
180
181 except Exception as exc:
182 if not quieterrors:
183 logger.critical(str(exc))
184 os._exit(1)
185 try:
186 if not cfg.dry_run:
187 ret = bb.build.exec_task(fn, taskname, the_data, cfg.profile)
188 os._exit(ret)
189 except:
190 os._exit(1)
191 else:
192 for key, value in envbackup.iteritems():
193 if value is None:
194 del os.environ[key]
195 else:
196 os.environ[key] = value
197
198 return pid, pipein, pipeout
199
200class runQueueWorkerPipe():
201 """
202 Abstraction for a pipe between a worker thread and the worker server
203 """
204 def __init__(self, pipein, pipeout):
205 self.input = pipein
206 if pipeout:
207 pipeout.close()
208 bb.utils.nonblockingfd(self.input)
209 self.queue = ""
210
211 def read(self):
212 start = len(self.queue)
213 try:
214 self.queue = self.queue + self.input.read(102400)
215 except (OSError, IOError) as e:
216 if e.errno != errno.EAGAIN:
217 raise
218
219 end = len(self.queue)
220 index = self.queue.find("</event>")
221 while index != -1:
222 worker_fire_prepickled(self.queue[:index+8])
223 self.queue = self.queue[index+8:]
224 index = self.queue.find("</event>")
225 return (end > start)
226
227 def close(self):
228 while self.read():
229 continue
230 if len(self.queue) > 0:
231 print("Warning, worker child left partial message: %s" % self.queue)
232 self.input.close()
233
234normalexit = False
235
236class BitbakeWorker(object):
237 def __init__(self, din):
238 self.input = din
239 bb.utils.nonblockingfd(self.input)
240 self.queue = ""
241 self.cookercfg = None
242 self.databuilder = None
243 self.data = None
244 self.build_pids = {}
245 self.build_pipes = {}
246
247 signal.signal(signal.SIGTERM, self.sigterm_exception)
248
249 def sigterm_exception(self, signum, stackframe):
250 bb.warn("Worker recieved SIGTERM, shutting down...")
251 self.handle_finishnow(None)
252 signal.signal(signal.SIGTERM, signal.SIG_DFL)
253 os.kill(os.getpid(), signal.SIGTERM)
254
255 def serve(self):
256 while True:
257 (ready, _, _) = select.select([self.input] + [i.input for i in self.build_pipes.values()], [] , [], 1)
258 if self.input in ready or len(self.queue):
259 start = len(self.queue)
260 try:
261 self.queue = self.queue + self.input.read()
262 except (OSError, IOError):
263 pass
264 end = len(self.queue)
265 self.handle_item("cookerconfig", self.handle_cookercfg)
266 self.handle_item("workerdata", self.handle_workerdata)
267 self.handle_item("runtask", self.handle_runtask)
268 self.handle_item("finishnow", self.handle_finishnow)
269 self.handle_item("ping", self.handle_ping)
270 self.handle_item("quit", self.handle_quit)
271
272 for pipe in self.build_pipes:
273 self.build_pipes[pipe].read()
274 if len(self.build_pids):
275 self.process_waitpid()
276 worker_flush()
277
278
279 def handle_item(self, item, func):
280 if self.queue.startswith("<" + item + ">"):
281 index = self.queue.find("</" + item + ">")
282 while index != -1:
283 func(self.queue[(len(item) + 2):index])
284 self.queue = self.queue[(index + len(item) + 3):]
285 index = self.queue.find("</" + item + ">")
286
287 def handle_cookercfg(self, data):
288 self.cookercfg = pickle.loads(data)
289 self.databuilder = bb.cookerdata.CookerDataBuilder(self.cookercfg, worker=True)
290 self.databuilder.parseBaseConfiguration()
291 self.data = self.databuilder.data
292
293 def handle_workerdata(self, data):
294 self.workerdata = pickle.loads(data)
295 bb.msg.loggerDefaultDebugLevel = self.workerdata["logdefaultdebug"]
296 bb.msg.loggerDefaultVerbose = self.workerdata["logdefaultverbose"]
297 bb.msg.loggerVerboseLogs = self.workerdata["logdefaultverboselogs"]
298 bb.msg.loggerDefaultDomains = self.workerdata["logdefaultdomain"]
299 self.data.setVar("PRSERV_HOST", self.workerdata["prhost"])
300
301 def handle_ping(self, _):
302 workerlog_write("Handling ping\n")
303
304 logger.warn("Pong from bitbake-worker!")
305
306 def handle_quit(self, data):
307 workerlog_write("Handling quit\n")
308
309 global normalexit
310 normalexit = True
311 sys.exit(0)
312
313 def handle_runtask(self, data):
314 fn, task, taskname, quieterrors, appends, taskdepdata = pickle.loads(data)
315 workerlog_write("Handling runtask %s %s %s\n" % (task, fn, taskname))
316
317 pid, pipein, pipeout = fork_off_task(self.cookercfg, self.data, self.workerdata, fn, task, taskname, appends, taskdepdata, quieterrors)
318
319 self.build_pids[pid] = task
320 self.build_pipes[pid] = runQueueWorkerPipe(pipein, pipeout)
321
322 def process_waitpid(self):
323 """
324 Return none is there are no processes awaiting result collection, otherwise
325 collect the process exit codes and close the information pipe.
326 """
327 try:
328 pid, status = os.waitpid(-1, os.WNOHANG)
329 if pid == 0 or os.WIFSTOPPED(status):
330 return None
331 except OSError:
332 return None
333
334 workerlog_write("Exit code of %s for pid %s\n" % (status, pid))
335
336 if os.WIFEXITED(status):
337 status = os.WEXITSTATUS(status)
338 elif os.WIFSIGNALED(status):
339 # Per shell conventions for $?, when a process exits due to
340 # a signal, we return an exit code of 128 + SIGNUM
341 status = 128 + os.WTERMSIG(status)
342
343 task = self.build_pids[pid]
344 del self.build_pids[pid]
345
346 self.build_pipes[pid].close()
347 del self.build_pipes[pid]
348
349 worker_fire_prepickled("<exitcode>" + pickle.dumps((task, status)) + "</exitcode>")
350
351 def handle_finishnow(self, _):
352 if self.build_pids:
353 logger.info("Sending SIGTERM to remaining %s tasks", len(self.build_pids))
354 for k, v in self.build_pids.iteritems():
355 try:
356 os.kill(-k, signal.SIGTERM)
357 os.waitpid(-1, 0)
358 except:
359 pass
360 for pipe in self.build_pipes:
361 self.build_pipes[pipe].read()
362
363try:
364 worker = BitbakeWorker(sys.stdin)
365 worker.serve()
366except BaseException as e:
367 if not normalexit:
368 import traceback
369 sys.stderr.write(traceback.format_exc())
370 sys.stderr.write(str(e))
371while len(worker_queue):
372 worker_flush()
373workerlog_write("exitting")
374sys.exit(0)
375
diff --git a/bitbake/bin/bitdoc b/bitbake/bin/bitdoc
new file mode 100755
index 0000000..576d88b
--- /dev/null
+++ b/bitbake/bin/bitdoc
@@ -0,0 +1,531 @@
1#!/usr/bin/env python
2# ex:ts=4:sw=4:sts=4:et
3# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
4#
5# Copyright (C) 2005 Holger Hans Peter Freyther
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License version 2 as
9# published by the Free Software Foundation.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License along
17# with this program; if not, write to the Free Software Foundation, Inc.,
18# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20import optparse, os, sys
21
22# bitbake
23sys.path.append(os.path.join(os.path.dirname(os.path.dirname(__file__), 'lib'))
24import bb
25import bb.parse
26from string import split, join
27
28__version__ = "0.0.2"
29
30class HTMLFormatter:
31 """
32 Simple class to help to generate some sort of HTML files. It is
33 quite inferior solution compared to docbook, gtkdoc, doxygen but it
34 should work for now.
35 We've a global introduction site (index.html) and then one site for
36 the list of keys (alphabetical sorted) and one for the list of groups,
37 one site for each key with links to the relations and groups.
38
39 index.html
40 all_keys.html
41 all_groups.html
42 groupNAME.html
43 keyNAME.html
44 """
45
46 def replace(self, text, *pairs):
47 """
48 From pydoc... almost identical at least
49 """
50 while pairs:
51 (a, b) = pairs[0]
52 text = join(split(text, a), b)
53 pairs = pairs[1:]
54 return text
55 def escape(self, text):
56 """
57 Escape string to be conform HTML
58 """
59 return self.replace(text,
60 ('&', '&amp;'),
61 ('<', '&lt;' ),
62 ('>', '&gt;' ) )
63 def createNavigator(self):
64 """
65 Create the navgiator
66 """
67 return """<table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
68<tr valign="middle">
69<td><a accesskey="g" href="index.html">Home</a></td>
70<td><a accesskey="n" href="all_groups.html">Groups</a></td>
71<td><a accesskey="u" href="all_keys.html">Keys</a></td>
72</tr></table>
73"""
74
75 def relatedKeys(self, item):
76 """
77 Create HTML to link to foreign keys
78 """
79
80 if len(item.related()) == 0:
81 return ""
82
83 txt = "<p><b>See also:</b><br>"
84 txts = []
85 for it in item.related():
86 txts.append("""<a href="key%(it)s.html">%(it)s</a>""" % vars() )
87
88 return txt + ",".join(txts)
89
90 def groups(self, item):
91 """
92 Create HTML to link to related groups
93 """
94
95 if len(item.groups()) == 0:
96 return ""
97
98
99 txt = "<p><b>See also:</b><br>"
100 txts = []
101 for group in item.groups():
102 txts.append( """<a href="group%s.html">%s</a> """ % (group, group) )
103
104 return txt + ",".join(txts)
105
106
107 def createKeySite(self, item):
108 """
109 Create a site for a key. It contains the header/navigator, a heading,
110 the description, links to related keys and to the groups.
111 """
112
113 return """<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
114<html><head><title>Key %s</title></head>
115<link rel="stylesheet" href="style.css" type="text/css">
116<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
117%s
118<h2><span class="refentrytitle">%s</span></h2>
119
120<div class="refsynopsisdiv">
121<h2>Synopsis</h2>
122<p>
123%s
124</p>
125</div>
126
127<div class="refsynopsisdiv">
128<h2>Related Keys</h2>
129<p>
130%s
131</p>
132</div>
133
134<div class="refsynopsisdiv">
135<h2>Groups</h2>
136<p>
137%s
138</p>
139</div>
140
141
142</body>
143""" % (item.name(), self.createNavigator(), item.name(),
144 self.escape(item.description()), self.relatedKeys(item), self.groups(item))
145
146 def createGroupsSite(self, doc):
147 """
148 Create the Group Overview site
149 """
150
151 groups = ""
152 sorted_groups = sorted(doc.groups())
153 for group in sorted_groups:
154 groups += """<a href="group%s.html">%s</a><br>""" % (group, group)
155
156 return """<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
157<html><head><title>Group overview</title></head>
158<link rel="stylesheet" href="style.css" type="text/css">
159<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
160%s
161<h2>Available Groups</h2>
162%s
163</body>
164""" % (self.createNavigator(), groups)
165
166 def createIndex(self):
167 """
168 Create the index file
169 """
170
171 return """<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
172<html><head><title>Bitbake Documentation</title></head>
173<link rel="stylesheet" href="style.css" type="text/css">
174<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
175%s
176<h2>Documentation Entrance</h2>
177<a href="all_groups.html">All available groups</a><br>
178<a href="all_keys.html">All available keys</a><br>
179</body>
180""" % self.createNavigator()
181
182 def createKeysSite(self, doc):
183 """
184 Create Overview of all avilable keys
185 """
186 keys = ""
187 sorted_keys = sorted(doc.doc_keys())
188 for key in sorted_keys:
189 keys += """<a href="key%s.html">%s</a><br>""" % (key, key)
190
191 return """<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
192<html><head><title>Key overview</title></head>
193<link rel="stylesheet" href="style.css" type="text/css">
194<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
195%s
196<h2>Available Keys</h2>
197%s
198</body>
199""" % (self.createNavigator(), keys)
200
201 def createGroupSite(self, gr, items, _description = None):
202 """
203 Create a site for a group:
204 Group the name of the group, items contain the name of the keys
205 inside this group
206 """
207 groups = ""
208 description = ""
209
210 # create a section with the group descriptions
211 if _description:
212 description += "<h2 Description of Grozp %s</h2>" % gr
213 description += _description
214
215 items.sort(lambda x, y:cmp(x.name(), y.name()))
216 for group in items:
217 groups += """<a href="key%s.html">%s</a><br>""" % (group.name(), group.name())
218
219 return """<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
220<html><head><title>Group %s</title></head>
221<link rel="stylesheet" href="style.css" type="text/css">
222<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
223%s
224%s
225<div class="refsynopsisdiv">
226<h2>Keys in Group %s</h2>
227<pre class="synopsis">
228%s
229</pre>
230</div>
231</body>
232""" % (gr, self.createNavigator(), description, gr, groups)
233
234
235
236 def createCSS(self):
237 """
238 Create the CSS file
239 """
240 return """.synopsis, .classsynopsis
241{
242 background: #eeeeee;
243 border: solid 1px #aaaaaa;
244 padding: 0.5em;
245}
246.programlisting
247{
248 background: #eeeeff;
249 border: solid 1px #aaaaff;
250 padding: 0.5em;
251}
252.variablelist
253{
254 padding: 4px;
255 margin-left: 3em;
256}
257.variablelist td:first-child
258{
259 vertical-align: top;
260}
261table.navigation
262{
263 background: #ffeeee;
264 border: solid 1px #ffaaaa;
265 margin-top: 0.5em;
266 margin-bottom: 0.5em;
267}
268.navigation a
269{
270 color: #770000;
271}
272.navigation a:visited
273{
274 color: #550000;
275}
276.navigation .title
277{
278 font-size: 200%;
279}
280div.refnamediv
281{
282 margin-top: 2em;
283}
284div.gallery-float
285{
286 float: left;
287 padding: 10px;
288}
289div.gallery-float img
290{
291 border-style: none;
292}
293div.gallery-spacer
294{
295 clear: both;
296}
297a
298{
299 text-decoration: none;
300}
301a:hover
302{
303 text-decoration: underline;
304 color: #FF0000;
305}
306"""
307
308
309
310class DocumentationItem:
311 """
312 A class to hold information about a configuration
313 item. It contains the key name, description, a list of related names,
314 and the group this item is contained in.
315 """
316
317 def __init__(self):
318 self._groups = []
319 self._related = []
320 self._name = ""
321 self._desc = ""
322
323 def groups(self):
324 return self._groups
325
326 def name(self):
327 return self._name
328
329 def description(self):
330 return self._desc
331
332 def related(self):
333 return self._related
334
335 def setName(self, name):
336 self._name = name
337
338 def setDescription(self, desc):
339 self._desc = desc
340
341 def addGroup(self, group):
342 self._groups.append(group)
343
344 def addRelation(self, relation):
345 self._related.append(relation)
346
347 def sort(self):
348 self._related.sort()
349 self._groups.sort()
350
351
352class Documentation:
353 """
354 Holds the documentation... with mappings from key to items...
355 """
356
357 def __init__(self):
358 self.__keys = {}
359 self.__groups = {}
360
361 def insert_doc_item(self, item):
362 """
363 Insert the Doc Item into the internal list
364 of representation
365 """
366 item.sort()
367 self.__keys[item.name()] = item
368
369 for group in item.groups():
370 if not group in self.__groups:
371 self.__groups[group] = []
372 self.__groups[group].append(item)
373 self.__groups[group].sort()
374
375
376 def doc_item(self, key):
377 """
378 Return the DocumentationInstance describing the key
379 """
380 try:
381 return self.__keys[key]
382 except KeyError:
383 return None
384
385 def doc_keys(self):
386 """
387 Return the documented KEYS (names)
388 """
389 return self.__keys.keys()
390
391 def groups(self):
392 """
393 Return the names of available groups
394 """
395 return self.__groups.keys()
396
397 def group_content(self, group_name):
398 """
399 Return a list of keys/names that are in a specefic
400 group or the empty list
401 """
402 try:
403 return self.__groups[group_name]
404 except KeyError:
405 return []
406
407
408def parse_cmdline(args):
409 """
410 Parse the CMD line and return the result as a n-tuple
411 """
412
413 parser = optparse.OptionParser( version = "Bitbake Documentation Tool Core version %s, %%prog version %s" % (bb.__version__, __version__))
414 usage = """%prog [options]
415
416Create a set of html pages (documentation) for a bitbake.conf....
417"""
418
419 # Add the needed options
420 parser.add_option( "-c", "--config", help = "Use the specified configuration file as source",
421 action = "store", dest = "config", default = os.path.join("conf", "documentation.conf") )
422
423 parser.add_option( "-o", "--output", help = "Output directory for html files",
424 action = "store", dest = "output", default = "html/" )
425
426 parser.add_option( "-D", "--debug", help = "Increase the debug level",
427 action = "count", dest = "debug", default = 0 )
428
429 parser.add_option( "-v", "--verbose", help = "output more chit-char to the terminal",
430 action = "store_true", dest = "verbose", default = False )
431
432 options, args = parser.parse_args( sys.argv )
433
434 bb.msg.init_msgconfig(options.verbose, options.debug)
435
436 return options.config, options.output
437
438def main():
439 """
440 The main Method
441 """
442
443 (config_file, output_dir) = parse_cmdline( sys.argv )
444
445 # right to let us load the file now
446 try:
447 documentation = bb.parse.handle( config_file, bb.data.init() )
448 except IOError:
449 bb.fatal( "Unable to open %s" % config_file )
450 except bb.parse.ParseError:
451 bb.fatal( "Unable to parse %s" % config_file )
452
453 if isinstance(documentation, dict):
454 documentation = documentation[""]
455
456 # Assuming we've the file loaded now, we will initialize the 'tree'
457 doc = Documentation()
458
459 # defined states
460 state_begin = 0
461 state_see = 1
462 state_group = 2
463
464 for key in bb.data.keys(documentation):
465 data = documentation.getVarFlag(key, "doc")
466 if not data:
467 continue
468
469 # The Documentation now starts
470 doc_ins = DocumentationItem()
471 doc_ins.setName(key)
472
473
474 tokens = data.split(' ')
475 state = state_begin
476 string= ""
477 for token in tokens:
478 token = token.strip(',')
479
480 if not state == state_see and token == "@see":
481 state = state_see
482 continue
483 elif not state == state_group and token == "@group":
484 state = state_group
485 continue
486
487 if state == state_begin:
488 string += " %s" % token
489 elif state == state_see:
490 doc_ins.addRelation(token)
491 elif state == state_group:
492 doc_ins.addGroup(token)
493
494 # set the description
495 doc_ins.setDescription(string)
496 doc.insert_doc_item(doc_ins)
497
498 # let us create the HTML now
499 bb.utils.mkdirhier(output_dir)
500 os.chdir(output_dir)
501
502 # Let us create the sites now. We do it in the following order
503 # Start with the index.html. It will point to sites explaining all
504 # keys and groups
505 html_slave = HTMLFormatter()
506
507 f = file('style.css', 'w')
508 print >> f, html_slave.createCSS()
509
510 f = file('index.html', 'w')
511 print >> f, html_slave.createIndex()
512
513 f = file('all_groups.html', 'w')
514 print >> f, html_slave.createGroupsSite(doc)
515
516 f = file('all_keys.html', 'w')
517 print >> f, html_slave.createKeysSite(doc)
518
519 # now for each group create the site
520 for group in doc.groups():
521 f = file('group%s.html' % group, 'w')
522 print >> f, html_slave.createGroupSite(group, doc.group_content(group))
523
524 # now for the keys
525 for key in doc.doc_keys():
526 f = file('key%s.html' % doc.doc_item(key).name(), 'w')
527 print >> f, html_slave.createKeySite(doc.doc_item(key))
528
529
530if __name__ == "__main__":
531 main()
diff --git a/bitbake/bin/image-writer b/bitbake/bin/image-writer
new file mode 100755
index 0000000..86c38b5
--- /dev/null
+++ b/bitbake/bin/image-writer
@@ -0,0 +1,122 @@
1#!/usr/bin/env python
2
3# Copyright (c) 2012 Wind River Systems, Inc.
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License version 2 as
7# published by the Free Software Foundation.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12# See the GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with this program; if not, write to the Free Software
16# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
18import os
19import sys
20sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname( \
21 os.path.abspath(__file__))), 'lib'))
22try:
23 import bb
24except RuntimeError as exc:
25 sys.exit(str(exc))
26
27import gtk
28import optparse
29import pygtk
30
31from bb.ui.crumbs.hobwidget import HobAltButton, HobButton
32from bb.ui.crumbs.hig.crumbsmessagedialog import CrumbsMessageDialog
33from bb.ui.crumbs.hig.deployimagedialog import DeployImageDialog
34from bb.ui.crumbs.hig.imageselectiondialog import ImageSelectionDialog
35
36# I put all the fs bitbake supported here. Need more test.
37DEPLOYABLE_IMAGE_TYPES = ["jffs2", "cramfs", "ext2", "ext3", "btrfs", "squashfs", "ubi", "vmdk"]
38Title = "USB Image Writer"
39
40class DeployWindow(gtk.Window):
41 def __init__(self, image_path=''):
42 super(DeployWindow, self).__init__()
43
44 if len(image_path) > 0:
45 valid = True
46 if not os.path.exists(image_path):
47 valid = False
48 lbl = "<b>Invalid image file path: %s.</b>\nPress <b>Select Image</b> to select an image." % image_path
49 else:
50 image_path = os.path.abspath(image_path)
51 extend_name = os.path.splitext(image_path)[1][1:]
52 if extend_name not in DEPLOYABLE_IMAGE_TYPES:
53 valid = False
54 lbl = "<b>Undeployable imge type: %s</b>\nPress <b>Select Image</b> to select an image." % extend_name
55
56 if not valid:
57 image_path = ''
58 crumbs_dialog = CrumbsMessageDialog(self, lbl, gtk.STOCK_DIALOG_INFO)
59 button = crumbs_dialog.add_button("Close", gtk.RESPONSE_OK)
60 HobButton.style_button(button)
61 crumbs_dialog.run()
62 crumbs_dialog.destroy()
63
64 self.deploy_dialog = DeployImageDialog(Title, image_path, self,
65 gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT
66 | gtk.DIALOG_NO_SEPARATOR, None, standalone=True)
67 close_button = self.deploy_dialog.add_button("Close", gtk.RESPONSE_NO)
68 HobAltButton.style_button(close_button)
69 close_button.connect('clicked', gtk.main_quit)
70
71 write_button = self.deploy_dialog.add_button("Write USB image", gtk.RESPONSE_YES)
72 HobAltButton.style_button(write_button)
73
74 self.deploy_dialog.connect('select_image_clicked', self.select_image_clicked_cb)
75 self.deploy_dialog.connect('destroy', gtk.main_quit)
76 response = self.deploy_dialog.show()
77
78 def select_image_clicked_cb(self, dialog):
79 cwd = os.getcwd()
80 dialog = ImageSelectionDialog(cwd, DEPLOYABLE_IMAGE_TYPES, Title, self, gtk.FILE_CHOOSER_ACTION_SAVE )
81 button = dialog.add_button("Cancel", gtk.RESPONSE_NO)
82 HobAltButton.style_button(button)
83 button = dialog.add_button("Open", gtk.RESPONSE_YES)
84 HobAltButton.style_button(button)
85 response = dialog.run()
86
87 if response == gtk.RESPONSE_YES:
88 if not dialog.image_names:
89 lbl = "<b>No selections made</b>\nClicked the radio button to select a image."
90 crumbs_dialog = CrumbsMessageDialog(self, lbl, gtk.STOCK_DIALOG_INFO)
91 button = crumbs_dialog.add_button("Close", gtk.RESPONSE_OK)
92 HobButton.style_button(button)
93 crumbs_dialog.run()
94 crumbs_dialog.destroy()
95 dialog.destroy()
96 return
97
98 # get the full path of image
99 image_path = os.path.join(dialog.image_folder, dialog.image_names[0])
100 self.deploy_dialog.set_image_text_buffer(image_path)
101 self.deploy_dialog.set_image_path(image_path)
102
103 dialog.destroy()
104
105def main():
106 parser = optparse.OptionParser(
107 usage = """%prog [-h] [image_file]
108
109%prog writes bootable images to USB devices. You can
110provide the image file on the command line or select it using the GUI.""")
111
112 options, args = parser.parse_args(sys.argv)
113 image_file = args[1] if len(args) > 1 else ''
114 dw = DeployWindow(image_file)
115
116if __name__ == '__main__':
117 try:
118 main()
119 gtk.main()
120 except Exception:
121 import traceback
122 traceback.print_exc(3)
diff --git a/bitbake/bin/toaster b/bitbake/bin/toaster
new file mode 100755
index 0000000..dea69a4
--- /dev/null
+++ b/bitbake/bin/toaster
@@ -0,0 +1,214 @@
1#!/bin/bash
2# (c) 2013 Intel Corp.
3
4# This program is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation; either version 2 of the License, or
7# (at your option) any later version.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with this program; if not, write to the Free Software
16# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
18
19# This script enables toaster event logging and
20# starts bitbake resident server
21# use as: source toaster [start|stop]
22
23# Helper function to kill a background toaster development server
24
25function webserverKillAll()
26{
27 local pidfile
28 for pidfile in ${BUILDDIR}/.toastermain.pid; do
29 if [ -f ${pidfile} ]; then
30 while kill -0 $(< ${pidfile}) 2>/dev/null; do
31 kill -SIGTERM -$(< ${pidfile}) 2>/dev/null
32 sleep 1;
33 done;
34 rm ${pidfile}
35 fi
36 done
37}
38
39function webserverStartAll()
40{
41 retval=0
42 python $BBBASEDIR/lib/toaster/manage.py syncdb || retval=1
43 python $BBBASEDIR/lib/toaster/manage.py migrate orm || retval=2
44 if [ $retval -eq 1 ]; then
45 echo "Failed db sync, stopping system start" 1>&2
46 elif [ $retval -eq 2 ]; then
47 echo -e "\nError on migration, trying to recover... \n"
48 python $BBBASEDIR/lib/toaster/manage.py migrate orm 0001_initial --fake
49 retval=0
50 python $BBBASEDIR/lib/toaster/manage.py migrate orm || retval=1
51 fi
52 if [ $retval -eq 0 ]; then
53 python $BBBASEDIR/lib/toaster/manage.py runserver 0.0.0.0:8000 </dev/null >${BUILDDIR}/toaster_web.log 2>&1 & echo $! >${BUILDDIR}/.toastermain.pid
54 sleep 1
55 if ! cat "${BUILDDIR}/.toastermain.pid" | xargs -I{} kill -0 {} ; then
56 retval=1
57 rm "${BUILDDIR}/.toastermain.pid"
58 fi
59 fi
60 return $retval
61}
62
63# Helper functions to add a special configuration file
64
65function addtoConfiguration()
66{
67 echo "#Created by toaster start script" > ${BUILDDIR}/conf/$2
68 echo $1 >> ${BUILDDIR}/conf/$2
69}
70
71INSTOPSYSTEM=0
72
73# define the stop command
74function stop_system()
75{
76 # prevent reentry
77 if [ $INSTOPSYSTEM == 1 ]; then return; fi
78 INSTOPSYSTEM=1
79 if [ -f ${BUILDDIR}/.toasterui.pid ]; then
80 kill $(< ${BUILDDIR}/.toasterui.pid ) 2>/dev/null
81 rm ${BUILDDIR}/.toasterui.pid
82 fi
83 BBSERVER=localhost:8200 bitbake -m
84 unset BBSERVER
85 webserverKillAll
86 # force stop any misbehaving bitbake server
87 lsof bitbake.lock | awk '{print $2}' | grep "[0-9]\+" | xargs -n1 -r kill
88 trap - SIGHUP
89 #trap - SIGCHLD
90 INSTOPSYSTEM=0
91}
92
93function check_pidbyfile() {
94 [ -e $1 ] && kill -0 $(< $1) 2>/dev/null
95}
96
97
98function notify_chldexit() {
99 if [ $NOTOASTERUI == 0 ]; then
100 check_pidbyfile ${BUILDDIR}/.toasterui.pid && return
101 stop_system
102 fi
103}
104
105
106# We make sure we're running in the current shell and in a good environment
107
108if [ -z "$ZSH_NAME" ] && [ `basename \"$0\"` = `basename \"$BASH_SOURCE\"` ]; then
109 echo "Error: This script needs to be sourced. Please run as 'source toaster [start|stop]'" 1>&2;
110 exit 1
111fi
112
113if [ -z "$BUILDDIR" ] || [ -z `which bitbake` ]; then
114 echo "Error: Build environment is not setup or bitbake is not in path." 1>&2;
115 return 2
116fi
117
118BBBASEDIR=`dirname ${BASH_SOURCE}`/..
119
120
121# Verify prerequisites
122
123if ! echo "import django; print (1,5) == django.VERSION[0:2]" | python 2>/dev/null | grep True >/dev/null; then
124 echo -e "This program needs Django 1.5. Please install with\n\nsudo pip install django==1.5"
125 return 2
126fi
127
128if ! echo "import south; print [0,8,4] == map(int,south.__version__.split(\".\"))" | python 2>/dev/null | grep True >/dev/null; then
129 echo -e "This program needs South 0.8.4. Please install with\n\nsudo pip install south==0.8.4"
130 return 2
131fi
132
133
134
135
136
137# Determine the action. If specified by arguments, fine, if not, toggle it
138if [ "x$1" == "xstart" ] || [ "x$1" == "xstop" ]; then
139 CMD="$1"
140else
141 if [ -z "$BBSERVER" ]; then
142 CMD="start"
143 else
144 CMD="stop"
145 fi;
146fi
147
148NOTOASTERUI=0
149for param in $*; do
150 case $param in
151 noui )
152 NOTOASTERUI=1
153 ;;
154 esac
155done
156
157echo "The system will $CMD."
158
159# Make sure it's safe to run by checking bitbake lock
160
161lock=1
162if [ -e $BUILDDIR/bitbake.lock ]; then
163 (flock -n 200 ) 200<$BUILDDIR/bitbake.lock || lock=0
164fi
165
166if [ ${CMD} == "start" ] && ( [ $lock -eq 0 ] || [ -e $BUILDDIR/.toastermain.pid ] ); then
167 echo "Error: bitbake lock state error. File locks show that the system is on." 2>&1
168 echo "If you see problems, stop and then start the system again." 2>&1
169 return 3
170fi
171
172
173# Execute the commands
174
175case $CMD in
176 start )
177 start_success=1
178 addtoConfiguration "INHERIT+=\"toaster buildhistory\"" toaster.conf
179 if ! webserverStartAll; then
180 echo "Failed ${CMD}."
181 return 4
182 fi
183 unset BBSERVER
184 bitbake --postread conf/toaster.conf --server-only -t xmlrpc -B localhost:8200
185 if [ $? -ne 0 ]; then
186 start_success=0
187 echo "Bitbake server start failed"
188 else
189 export BBSERVER=localhost:8200
190 if [ $NOTOASTERUI == 0 ]; then # we start the TOASTERUI only if not inhibited
191 bitbake --observe-only -u toasterui >${BUILDDIR}/toaster_ui.log 2>&1 & echo $! >${BUILDDIR}/.toasterui.pid
192 fi
193 fi
194 if [ $start_success -eq 1 ]; then
195 # set fail safe stop system on terminal exit
196 trap stop_system SIGHUP
197 echo "Successful ${CMD}."
198 else
199 # failed start, do stop
200 stop_system
201 echo "Failed ${CMD}."
202 fi
203 # stop system on terminal exit
204 set -o monitor
205 trap stop_system SIGHUP
206 #trap notify_chldexit SIGCHLD
207 ;;
208 stop )
209 stop_system
210 echo "Successful ${CMD}."
211 ;;
212esac
213
214
diff --git a/bitbake/contrib/README b/bitbake/contrib/README
new file mode 100644
index 0000000..25e5156
--- /dev/null
+++ b/bitbake/contrib/README
@@ -0,0 +1 @@
This directory is for additional contributed files which may be useful.
diff --git a/bitbake/contrib/bbdev.sh b/bitbake/contrib/bbdev.sh
new file mode 100644
index 0000000..33a7853
--- /dev/null
+++ b/bitbake/contrib/bbdev.sh
@@ -0,0 +1,31 @@
1# This is a shell function to be sourced into your shell or placed in your .profile,
2# which makes setting things up for BitBake a bit easier.
3#
4# The author disclaims copyright to the contents of this file and places it in the
5# public domain.
6
7bbdev () {
8 local BBDIR PKGDIR BUILDDIR
9 if test x"$1" = "x--help"; then echo >&2 "syntax: bbdev [bbdir [pkgdir [builddir]]]"; return 1; fi
10 if test x"$1" = x; then BBDIR=`pwd`; else BBDIR=$1; fi
11 if test x"$2" = x; then PKGDIR=`pwd`; else PKGDIR=$2; fi
12 if test x"$3" = x; then BUILDDIR=`pwd`; else BUILDDIR=$3; fi
13
14 BBDIR=`readlink -f $BBDIR`
15 PKGDIR=`readlink -f $PKGDIR`
16 BUILDDIR=`readlink -f $BUILDDIR`
17 if ! (test -d $BBDIR && test -d $PKGDIR && test -d $BUILDDIR); then
18 echo >&2 "syntax: bbdev [bbdir [pkgdir [builddir]]]"
19 return 1
20 fi
21
22 PATH=$BBDIR/bin:$PATH
23 BBPATH=$BBDIR
24 if test x"$BBDIR" != x"$PKGDIR"; then
25 BBPATH=$PKGDIR:$BBPATH
26 fi
27 if test x"$PKGDIR" != x"$BUILDDIR"; then
28 BBPATH=$BUILDDIR:$BBPATH
29 fi
30 export BBPATH
31}
diff --git a/bitbake/contrib/dump_cache.py b/bitbake/contrib/dump_cache.py
new file mode 100755
index 0000000..e1f2309
--- /dev/null
+++ b/bitbake/contrib/dump_cache.py
@@ -0,0 +1,68 @@
1#!/usr/bin/env python
2# ex:ts=4:sw=4:sts=4:et
3# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
4#
5# Copyright (C) 2012 Wind River Systems, Inc.
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License version 2 as
9# published by the Free Software Foundation.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License along
17# with this program; if not, write to the Free Software Foundation, Inc.,
18# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20#
21# This is used for dumping the bb_cache.dat, the output format is:
22# recipe_path PN PV PACKAGES