From f4cf9fe05bb3f32fabea4e54dd92d368967a80da Mon Sep 17 00:00:00 2001 From: Adrian Dudau Date: Thu, 26 Jun 2014 14:36:22 +0200 Subject: initial commit for Enea Linux 4.0 Migrated from the internal git server on the daisy-enea branch Signed-off-by: Adrian Dudau --- scripts/README | 1 + scripts/bitbake-prserv-tool | 103 + scripts/bitbake-whatchanged | 339 ++ scripts/buildhistory-collect-srcrevs | 109 + scripts/buildhistory-diff | 104 + scripts/cleanup-workdir | 194 + scripts/combo-layer | 600 +++ scripts/combo-layer-hook-default.sh | 13 + scripts/combo-layer.conf.example | 56 + scripts/contrib/bb-perf/bb-matrix-plot.sh | 137 + scripts/contrib/bb-perf/bb-matrix.sh | 79 + scripts/contrib/bbvars.py | 186 + scripts/contrib/build-perf-test.sh | 369 ++ scripts/contrib/ddimage | 89 + scripts/contrib/documentation-audit.sh | 94 + scripts/contrib/graph-tool | 92 + scripts/contrib/list-packageconfig-flags.py | 209 + scripts/contrib/mkefidisk.sh | 286 ++ scripts/contrib/python/generate-manifest-2.7.py | 388 ++ scripts/contrib/python/generate-manifest-3.3.py | 380 ++ scripts/contrib/test_build_time.sh | 237 + scripts/contrib/test_build_time_worker.sh | 37 + scripts/cp-noerror | 52 + scripts/create-pull-request | 240 + scripts/create-recipe | 2072 +++++++++ scripts/crosstap | 148 + scripts/gen-site-config | 53 + scripts/help2man | 3 + scripts/hob | 6 + scripts/jhbuild/jhbuild2oe.py | 278 ++ scripts/jhbuild/modulesets/bootstrap.modules | 87 + scripts/jhbuild/modulesets/freedesktop.modules | 281 ++ scripts/jhbuild/modulesets/gcj.modules | 135 + scripts/jhbuild/modulesets/gnome-2.10.modules | 1621 +++++++ scripts/jhbuild/modulesets/gnome-2.12.modules | 1747 +++++++ scripts/jhbuild/modulesets/gnome-2.14.modules | 2013 ++++++++ scripts/jhbuild/modulesets/gnome-2.16.modules | 2087 +++++++++ scripts/jhbuild/modulesets/gnutls.modules | 36 + scripts/jhbuild/modulesets/gtk.modules | 72 + scripts/jhbuild/modulesets/gtk28.modules | 72 + scripts/jhbuild/modulesets/moduleset.dtd | 115 + scripts/jhbuild/modulesets/moduleset.rnc | 131 + scripts/jhbuild/modulesets/moduleset.xsl | 283 ++ scripts/jhbuild/modulesets/schemas.xml | 4 + scripts/jhbuild/modulesets/xorg-7.0.modules | 4847 ++++++++++++++++++++ scripts/jhbuild/modulesets/xorg.modules | 2201 +++++++++ scripts/lib/bsp/__init__.py | 22 + scripts/lib/bsp/engine.py | 1780 +++++++ scripts/lib/bsp/help.py | 1043 +++++ scripts/lib/bsp/kernel.py | 1071 +++++ .../lib/bsp/substrate/target/arch/arm/.gitignore | 0 .../target/arch/arm/conf/machine/{{=machine}}.conf | 105 + .../{{ if xserver == \"y\": }} xorg.conf" | 33 + ... == \"y\": }} xserver-xf86-config_0.1.bbappend" | 1 + .../arm/recipes-kernel/linux/kernel-list.noinstall | 5 + .../{{=machine}}-non_hardware.cfg" | 30 + .../{{=machine}}-preempt-rt.scc" | 13 + .../{{=machine}}-standard.scc" | 13 + .../{{=machine}}-tiny.scc" | 9 + .../{{=machine}}-user-config.cfg" | 0 .../{{=machine}}-user-features.scc" | 0 .../{{=machine}}-user-patches.scc" | 0 .../{{=machine}}.cfg" | 320 ++ .../{{=machine}}.scc" | 7 + ...linux-yocto-dev\": }} linux-yocto-dev.bbappend" | 25 + ...cto-rt_3.10\": }} linux-yocto-rt_3.10.bbappend" | 32 + ...tiny_3.10\": }} linux-yocto-tiny_3.10.bbappend" | 32 + ...tiny_3.14\": }} linux-yocto-tiny_3.14.bbappend" | 32 + ...nux-yocto_3.10\": }} linux-yocto_3.10.bbappend" | 32 + ...nux-yocto_3.14\": }} linux-yocto_3.14.bbappend" | 32 + .../bsp/substrate/target/arch/common/COPYING.MIT | 17 + .../lib/bsp/substrate/target/arch/common/README | 118 + .../substrate/target/arch/common/README.sources | 17 + .../substrate/target/arch/common/binary/.gitignore | 0 .../substrate/target/arch/common/conf/layer.conf | 10 + .../formfactor/formfactor/{{=machine}}/machconfig | 5 + .../recipes-bsp/formfactor/formfactor_0.0.bbappend | 2 + .../recipes-kernel/linux/kernel-list.noinstall | 26 + ...choice == \"custom\": }} linux-yocto-custom.bb" | 57 + .../defconfig" | 5 + .../{{=machine}}-user-config.cfg" | 8 + .../{{=machine}}-user-patches.scc" | 8 + .../{{=machine}}.cfg" | 3 + .../{{=machine}}.scc" | 17 + .../arch/i386/conf/machine/{{=machine}}.conf | 68 + .../{{ if xserver == \"y\": }} xorg.conf" | 0 ... == \"y\": }} xserver-xf86-config_0.1.bbappend" | 1 + .../recipes-kernel/linux/kernel-list.noinstall | 5 + .../{{=machine}}-preempt-rt.scc" | 15 + .../{{=machine}}-standard.scc" | 15 + .../{{=machine}}-tiny.scc" | 9 + .../{{=machine}}-user-config.cfg" | 0 .../{{=machine}}-user-features.scc" | 0 .../{{=machine}}-user-patches.scc" | 0 .../{{=machine}}.cfg" | 54 + .../{{=machine}}.scc" | 20 + ...linux-yocto-dev\": }} linux-yocto-dev.bbappend" | 25 + ...cto-rt_3.10\": }} linux-yocto-rt_3.10.bbappend" | 32 + ...tiny_3.10\": }} linux-yocto-tiny_3.10.bbappend" | 32 + ...tiny_3.14\": }} linux-yocto-tiny_3.14.bbappend" | 32 + ...nux-yocto_3.10\": }} linux-yocto_3.10.bbappend" | 32 + ...nux-yocto_3.14\": }} linux-yocto_3.14.bbappend" | 32 + .../bsp/substrate/target/arch/layer/COPYING.MIT | 17 + scripts/lib/bsp/substrate/target/arch/layer/README | 64 + .../substrate/target/arch/layer/conf/layer.conf | 10 + .../target/arch/layer/layer-questions.noinstall | 14 + .../example.patch" | 12 + ..._name}}_{{=example_bbappend_version}}.bbappend" | 8 + .../{{=example_recipe_name}}-0.1/example.patch" | 12 + .../{{=example_recipe_name}}-0.1/helloworld.c" | 8 + .../example/{{=example_recipe_name}}_0.1.bb" | 23 + .../lib/bsp/substrate/target/arch/mips/.gitignore | 0 .../arch/mips/conf/machine/{{=machine}}.conf | 38 + .../recipes-kernel/linux/kernel-list.noinstall | 5 + .../{{=machine}}-preempt-rt.scc" | 9 + .../{{=machine}}-standard.scc" | 9 + .../{{=machine}}-tiny.scc" | 9 + .../{{=machine}}-user-config.cfg" | 0 .../{{=machine}}-user-features.scc" | 0 .../{{=machine}}-user-patches.scc" | 0 .../{{=machine}}.cfg" | 1 + .../{{=machine}}.scc" | 7 + ...linux-yocto-dev\": }} linux-yocto-dev.bbappend" | 25 + ...cto-rt_3.10\": }} linux-yocto-rt_3.10.bbappend" | 32 + ...tiny_3.10\": }} linux-yocto-tiny_3.10.bbappend" | 32 + ...tiny_3.14\": }} linux-yocto-tiny_3.14.bbappend" | 32 + ...nux-yocto_3.10\": }} linux-yocto_3.10.bbappend" | 32 + ...nux-yocto_3.14\": }} linux-yocto_3.14.bbappend" | 32 + .../bsp/substrate/target/arch/powerpc/.gitignore | 0 .../arch/powerpc/conf/machine/{{=machine}}.conf | 74 + .../recipes-kernel/linux/kernel-list.noinstall | 5 + .../{{=machine}}-preempt-rt.scc" | 9 + .../{{=machine}}-standard.scc" | 9 + .../{{=machine}}-tiny.scc" | 9 + .../{{=machine}}-user-config.cfg" | 0 .../{{=machine}}-user-features.scc" | 0 .../{{=machine}}-user-patches.scc" | 0 .../{{=machine}}.cfg" | 163 + .../{{=machine}}.scc" | 9 + ...linux-yocto-dev\": }} linux-yocto-dev.bbappend" | 25 + ...cto-rt_3.10\": }} linux-yocto-rt_3.10.bbappend" | 32 + ...tiny_3.10\": }} linux-yocto-tiny_3.10.bbappend" | 32 + ...tiny_3.14\": }} linux-yocto-tiny_3.14.bbappend" | 32 + ...nux-yocto_3.10\": }} linux-yocto_3.10.bbappend" | 32 + ...nux-yocto_3.14\": }} linux-yocto_3.14.bbappend" | 32 + .../arch/qemu/conf/machine/{{=machine}}.conf | 68 + .../init-ifupdown/{{=machine}}/interfaces | 5 + .../init-ifupdown/init-ifupdown_1.0.bbappend | 1 + .../xserver-xf86-config/{{=machine}}/xorg.conf | 77 + .../xorg-xserver/xserver-xf86-config_0.1.bbappend | 1 + .../recipes-kernel/linux/kernel-list.noinstall | 5 + .../{{=machine}}-preempt-rt.scc" | 9 + .../{{=machine}}-standard.scc" | 16 + .../{{=machine}}-tiny.scc" | 9 + .../{{=machine}}-user-config.cfg" | 0 .../{{=machine}}-user-features.scc" | 0 .../{{=machine}}-user-patches.scc" | 0 .../{{=machine}}.cfg" | 0 .../{{=machine}}.scc" | 4 + ...linux-yocto-dev\": }} linux-yocto-dev.bbappend" | 49 + ...cto-rt_3.10\": }} linux-yocto-rt_3.10.bbappend" | 55 + ...tiny_3.10\": }} linux-yocto-tiny_3.10.bbappend" | 55 + ...-tiny_3.14\": }} linux-yocto-tiny_3.4.bbappend" | 55 + ...nux-yocto_3.10\": }} linux-yocto_3.10.bbappend" | 55 + ...nux-yocto_3.14\": }} linux-yocto_3.14.bbappend" | 55 + .../bsp/substrate/target/arch/x86_64/.gitignore | 0 .../arch/x86_64/conf/machine/{{=machine}}.conf | 58 + .../{{ if xserver == \"y\": }} xorg.conf" | 0 ... == \"y\": }} xserver-xf86-config_0.1.bbappend" | 1 + .../recipes-kernel/linux/kernel-list.noinstall | 5 + .../{{=machine}}-preempt-rt.scc" | 15 + .../{{=machine}}-standard.scc" | 15 + .../{{=machine}}-tiny.scc" | 9 + .../{{=machine}}-user-config.cfg" | 0 .../{{=machine}}-user-features.scc" | 0 .../{{=machine}}-user-patches.scc" | 0 .../{{=machine}}.cfg" | 47 + .../{{=machine}}.scc" | 13 + ...linux-yocto-dev\": }} linux-yocto-dev.bbappend" | 25 + ...cto-rt_3.10\": }} linux-yocto-rt_3.10.bbappend" | 32 + ...tiny_3.10\": }} linux-yocto-tiny_3.10.bbappend" | 32 + ...tiny_3.14\": }} linux-yocto-tiny_3.14.bbappend" | 32 + ...nux-yocto_3.10\": }} linux-yocto_3.10.bbappend" | 32 + ...nux-yocto_3.14\": }} linux-yocto_3.14.bbappend" | 32 + scripts/lib/bsp/tags.py | 47 + scripts/lib/image/__init__.py | 22 + scripts/lib/image/canned-wks/directdisk.wks | 10 + scripts/lib/image/canned-wks/mkefidisk.wks | 11 + scripts/lib/image/canned-wks/uboot.wks | 17 + scripts/lib/image/config/wic.conf | 11 + scripts/lib/image/engine.py | 287 ++ scripts/lib/image/help.py | 311 ++ scripts/lib/mic/3rdparty/pykickstart/__init__.py | 0 scripts/lib/mic/3rdparty/pykickstart/base.py | 466 ++ .../mic/3rdparty/pykickstart/commands/__init__.py | 26 + .../3rdparty/pykickstart/commands/authconfig.py | 40 + .../mic/3rdparty/pykickstart/commands/autopart.py | 119 + .../mic/3rdparty/pykickstart/commands/autostep.py | 55 + .../3rdparty/pykickstart/commands/bootloader.py | 265 ++ .../mic/3rdparty/pykickstart/commands/clearpart.py | 86 + .../mic/3rdparty/pykickstart/commands/device.py | 125 + .../3rdparty/pykickstart/commands/deviceprobe.py | 40 + .../3rdparty/pykickstart/commands/displaymode.py | 68 + .../mic/3rdparty/pykickstart/commands/dmraid.py | 91 + .../3rdparty/pykickstart/commands/driverdisk.py | 184 + .../lib/mic/3rdparty/pykickstart/commands/fcoe.py | 114 + .../mic/3rdparty/pykickstart/commands/firewall.py | 193 + .../mic/3rdparty/pykickstart/commands/firstboot.py | 62 + .../lib/mic/3rdparty/pykickstart/commands/group.py | 88 + .../3rdparty/pykickstart/commands/ignoredisk.py | 139 + .../3rdparty/pykickstart/commands/interactive.py | 58 + .../lib/mic/3rdparty/pykickstart/commands/iscsi.py | 133 + .../mic/3rdparty/pykickstart/commands/iscsiname.py | 54 + .../lib/mic/3rdparty/pykickstart/commands/key.py | 64 + .../mic/3rdparty/pykickstart/commands/keyboard.py | 55 + .../lib/mic/3rdparty/pykickstart/commands/lang.py | 60 + .../3rdparty/pykickstart/commands/langsupport.py | 58 + .../mic/3rdparty/pykickstart/commands/lilocheck.py | 54 + .../mic/3rdparty/pykickstart/commands/logging.py | 66 + .../mic/3rdparty/pykickstart/commands/logvol.py | 304 ++ .../3rdparty/pykickstart/commands/mediacheck.py | 53 + .../mic/3rdparty/pykickstart/commands/method.py | 186 + .../mic/3rdparty/pykickstart/commands/monitor.py | 106 + .../lib/mic/3rdparty/pykickstart/commands/mouse.py | 70 + .../mic/3rdparty/pykickstart/commands/multipath.py | 111 + .../mic/3rdparty/pykickstart/commands/network.py | 363 ++ .../mic/3rdparty/pykickstart/commands/partition.py | 353 ++ .../lib/mic/3rdparty/pykickstart/commands/raid.py | 365 ++ .../mic/3rdparty/pykickstart/commands/reboot.py | 79 + .../lib/mic/3rdparty/pykickstart/commands/repo.py | 249 + .../mic/3rdparty/pykickstart/commands/rescue.py | 68 + .../mic/3rdparty/pykickstart/commands/rootpw.py | 93 + .../mic/3rdparty/pykickstart/commands/selinux.py | 64 + .../mic/3rdparty/pykickstart/commands/services.py | 71 + .../lib/mic/3rdparty/pykickstart/commands/skipx.py | 54 + .../lib/mic/3rdparty/pykickstart/commands/sshpw.py | 105 + .../mic/3rdparty/pykickstart/commands/timezone.py | 86 + .../mic/3rdparty/pykickstart/commands/updates.py | 60 + .../mic/3rdparty/pykickstart/commands/upgrade.py | 106 + .../lib/mic/3rdparty/pykickstart/commands/user.py | 173 + .../lib/mic/3rdparty/pykickstart/commands/vnc.py | 114 + .../mic/3rdparty/pykickstart/commands/volgroup.py | 102 + .../mic/3rdparty/pykickstart/commands/xconfig.py | 184 + .../mic/3rdparty/pykickstart/commands/zerombr.py | 69 + .../lib/mic/3rdparty/pykickstart/commands/zfcp.py | 134 + scripts/lib/mic/3rdparty/pykickstart/constants.py | 57 + scripts/lib/mic/3rdparty/pykickstart/errors.py | 103 + .../mic/3rdparty/pykickstart/handlers/__init__.py | 0 .../mic/3rdparty/pykickstart/handlers/control.py | 1307 ++++++ .../lib/mic/3rdparty/pykickstart/handlers/f10.py | 24 + .../lib/mic/3rdparty/pykickstart/handlers/f11.py | 24 + .../lib/mic/3rdparty/pykickstart/handlers/f12.py | 24 + .../lib/mic/3rdparty/pykickstart/handlers/f13.py | 24 + .../lib/mic/3rdparty/pykickstart/handlers/f14.py | 24 + .../lib/mic/3rdparty/pykickstart/handlers/f15.py | 24 + .../lib/mic/3rdparty/pykickstart/handlers/f16.py | 24 + .../lib/mic/3rdparty/pykickstart/handlers/f7.py | 24 + .../lib/mic/3rdparty/pykickstart/handlers/f8.py | 24 + .../lib/mic/3rdparty/pykickstart/handlers/f9.py | 24 + .../lib/mic/3rdparty/pykickstart/handlers/fc3.py | 24 + .../lib/mic/3rdparty/pykickstart/handlers/fc4.py | 24 + .../lib/mic/3rdparty/pykickstart/handlers/fc5.py | 24 + .../lib/mic/3rdparty/pykickstart/handlers/fc6.py | 24 + .../lib/mic/3rdparty/pykickstart/handlers/rhel3.py | 24 + .../lib/mic/3rdparty/pykickstart/handlers/rhel4.py | 24 + .../lib/mic/3rdparty/pykickstart/handlers/rhel5.py | 24 + .../lib/mic/3rdparty/pykickstart/handlers/rhel6.py | 24 + scripts/lib/mic/3rdparty/pykickstart/ko.py | 37 + scripts/lib/mic/3rdparty/pykickstart/options.py | 204 + scripts/lib/mic/3rdparty/pykickstart/parser.py | 702 +++ scripts/lib/mic/3rdparty/pykickstart/sections.py | 244 + .../3rdparty/pykickstart/urlgrabber/__init__.py | 53 + .../3rdparty/pykickstart/urlgrabber/byterange.py | 463 ++ .../mic/3rdparty/pykickstart/urlgrabber/grabber.py | 1477 ++++++ .../3rdparty/pykickstart/urlgrabber/keepalive.py | 617 +++ .../mic/3rdparty/pykickstart/urlgrabber/mirror.py | 458 ++ .../3rdparty/pykickstart/urlgrabber/progress.py | 530 +++ .../3rdparty/pykickstart/urlgrabber/sslfactory.py | 90 + scripts/lib/mic/3rdparty/pykickstart/version.py | 197 + scripts/lib/mic/__init__.py | 4 + scripts/lib/mic/__version__.py | 1 + scripts/lib/mic/bootstrap.py | 279 ++ scripts/lib/mic/chroot.py | 343 ++ scripts/lib/mic/conf.py | 197 + scripts/lib/mic/creator.py | 351 ++ scripts/lib/mic/imager/__init__.py | 0 scripts/lib/mic/imager/baseimager.py | 1263 +++++ scripts/lib/mic/imager/direct.py | 384 ++ scripts/lib/mic/imager/fs.py | 99 + scripts/lib/mic/imager/livecd.py | 750 +++ scripts/lib/mic/imager/liveusb.py | 308 ++ scripts/lib/mic/imager/loop.py | 418 ++ scripts/lib/mic/imager/raw.py | 501 ++ scripts/lib/mic/kickstart/__init__.py | 892 ++++ .../lib/mic/kickstart/custom_commands/__init__.py | 17 + .../lib/mic/kickstart/custom_commands/desktop.py | 95 + .../mic/kickstart/custom_commands/installerfw.py | 63 + .../lib/mic/kickstart/custom_commands/micboot.py | 49 + .../mic/kickstart/custom_commands/micpartition.py | 57 + .../lib/mic/kickstart/custom_commands/micrepo.py | 127 + .../lib/mic/kickstart/custom_commands/partition.py | 482 ++ .../lib/mic/kickstart/custom_commands/wicboot.py | 57 + scripts/lib/mic/msger.py | 309 ++ scripts/lib/mic/plugin.py | 121 + scripts/lib/mic/pluginbase.py | 158 + scripts/lib/mic/plugins/backend/yumpkgmgr.py | 490 ++ scripts/lib/mic/plugins/backend/zypppkgmgr.py | 973 ++++ scripts/lib/mic/plugins/hook/.py | 0 scripts/lib/mic/plugins/hook/empty_hook.py | 3 + scripts/lib/mic/plugins/imager/direct_plugin.py | 107 + scripts/lib/mic/plugins/imager/fs_plugin.py | 143 + scripts/lib/mic/plugins/imager/livecd_plugin.py | 255 + scripts/lib/mic/plugins/imager/liveusb_plugin.py | 260 ++ scripts/lib/mic/plugins/imager/loop_plugin.py | 255 + scripts/lib/mic/plugins/imager/raw_plugin.py | 275 ++ scripts/lib/mic/plugins/source/bootimg-efi.py | 169 + scripts/lib/mic/plugins/source/bootimg-pcbios.py | 195 + scripts/lib/mic/plugins/source/rootfs.py | 71 + scripts/lib/mic/plugins/source/uboot.py | 173 + scripts/lib/mic/rt_util.py | 223 + scripts/lib/mic/test | 1 + scripts/lib/mic/utils/BmapCreate.py | 298 ++ scripts/lib/mic/utils/Fiemap.py | 252 + scripts/lib/mic/utils/__init__.py | 0 scripts/lib/mic/utils/cmdln.py | 1586 +++++++ scripts/lib/mic/utils/errors.py | 71 + scripts/lib/mic/utils/fs_related.py | 1060 +++++ scripts/lib/mic/utils/gpt_parser.py | 331 ++ scripts/lib/mic/utils/grabber.py | 97 + scripts/lib/mic/utils/misc.py | 1065 +++++ scripts/lib/mic/utils/oe/__init__.py | 22 + scripts/lib/mic/utils/oe/misc.py | 144 + scripts/lib/mic/utils/oe/package_manager.py | 810 ++++ scripts/lib/mic/utils/partitionedfs.py | 782 ++++ scripts/lib/mic/utils/proxy.py | 183 + scripts/lib/mic/utils/rpmmisc.py | 600 +++ scripts/lib/mic/utils/runner.py | 109 + scripts/lnr | 21 + scripts/multilib_header_wrapper.h | 55 + scripts/native-intercept/chown | 2 + scripts/oe-buildenv-internal | 109 + scripts/oe-find-native-sysroot | 81 + scripts/oe-git-proxy | 133 + scripts/oe-pkgdata-util | 332 ++ scripts/oe-selftest | 162 + scripts/oe-setup-builddir | 134 + scripts/oe-setup-rpmrepo | 97 + scripts/oe-trim-schemas | 49 + scripts/opkg-query-helper.py | 85 + scripts/postinst-intercepts/postinst_intercept | 56 + scripts/postinst-intercepts/update_font_cache | 6 + scripts/postinst-intercepts/update_icon_cache | 12 + scripts/postinst-intercepts/update_pixbuf_cache | 11 + scripts/pybootchartgui/AUTHORS | 11 + scripts/pybootchartgui/COPYING | 340 ++ scripts/pybootchartgui/MAINTAINERS | 3 + scripts/pybootchartgui/NEWS | 204 + scripts/pybootchartgui/README.pybootchart | 37 + scripts/pybootchartgui/pybootchartgui.py | 23 + scripts/pybootchartgui/pybootchartgui/__init__.py | 0 scripts/pybootchartgui/pybootchartgui/batch.py | 46 + scripts/pybootchartgui/pybootchartgui/draw.py | 894 ++++ scripts/pybootchartgui/pybootchartgui/gui.py | 350 ++ scripts/pybootchartgui/pybootchartgui/main.py | 1 + scripts/pybootchartgui/pybootchartgui/main.py.in | 187 + scripts/pybootchartgui/pybootchartgui/parsing.py | 740 +++ .../pybootchartgui/pybootchartgui/process_tree.py | 292 ++ scripts/pybootchartgui/pybootchartgui/samples.py | 151 + .../pybootchartgui/tests/parser_test.py | 105 + .../pybootchartgui/tests/process_tree_test.py | 92 + scripts/relocate_sdk.py | 243 + scripts/rootfs_rpm-extract-postinst.awk | 11 + scripts/rpm2cpio.sh | 53 + scripts/runqemu | 507 ++ scripts/runqemu-addptable2image | 51 + scripts/runqemu-export-rootfs | 163 + scripts/runqemu-extract-sdk | 103 + scripts/runqemu-gen-tapdevs | 91 + scripts/runqemu-ifdown | 66 + scripts/runqemu-ifup | 106 + scripts/runqemu-internal | 659 +++ scripts/runqemu.README | 42 + scripts/send-error-report | 80 + scripts/send-pull-request | 179 + scripts/sstate-cache-management.sh | 469 ++ scripts/sstate-diff-machines.sh | 107 + scripts/sstate-sysroot-cruft.sh | 78 + scripts/swabber-strace-attach | 31 + scripts/sysroot-relativelinks.py | 31 + scripts/test-dependencies.sh | 256 ++ scripts/test-reexec | 123 + scripts/tiny/dirsize.py | 93 + scripts/tiny/ksize.py | 165 + scripts/wic | 302 ++ scripts/wipe-sysroot | 54 + scripts/yocto-bsp | 156 + scripts/yocto-kernel | 399 ++ scripts/yocto-layer | 147 + 398 files changed, 71835 insertions(+) create mode 100644 scripts/README create mode 100755 scripts/bitbake-prserv-tool create mode 100755 scripts/bitbake-whatchanged create mode 100755 scripts/buildhistory-collect-srcrevs create mode 100755 scripts/buildhistory-diff create mode 100755 scripts/cleanup-workdir create mode 100755 scripts/combo-layer create mode 100755 scripts/combo-layer-hook-default.sh create mode 100644 scripts/combo-layer.conf.example create mode 100755 scripts/contrib/bb-perf/bb-matrix-plot.sh create mode 100755 scripts/contrib/bb-perf/bb-matrix.sh create mode 100755 scripts/contrib/bbvars.py create mode 100755 scripts/contrib/build-perf-test.sh create mode 100755 scripts/contrib/ddimage create mode 100755 scripts/contrib/documentation-audit.sh create mode 100755 scripts/contrib/graph-tool create mode 100755 scripts/contrib/list-packageconfig-flags.py create mode 100755 scripts/contrib/mkefidisk.sh create mode 100755 scripts/contrib/python/generate-manifest-2.7.py create mode 100755 scripts/contrib/python/generate-manifest-3.3.py create mode 100755 scripts/contrib/test_build_time.sh create mode 100755 scripts/contrib/test_build_time_worker.sh create mode 100755 scripts/cp-noerror create mode 100755 scripts/create-pull-request create mode 100755 scripts/create-recipe create mode 100755 scripts/crosstap create mode 100755 scripts/gen-site-config create mode 100755 scripts/help2man create mode 100755 scripts/hob create mode 100755 scripts/jhbuild/jhbuild2oe.py create mode 100644 scripts/jhbuild/modulesets/bootstrap.modules create mode 100644 scripts/jhbuild/modulesets/freedesktop.modules create mode 100644 scripts/jhbuild/modulesets/gcj.modules create mode 100644 scripts/jhbuild/modulesets/gnome-2.10.modules create mode 100644 scripts/jhbuild/modulesets/gnome-2.12.modules create mode 100644 scripts/jhbuild/modulesets/gnome-2.14.modules create mode 100644 scripts/jhbuild/modulesets/gnome-2.16.modules create mode 100644 scripts/jhbuild/modulesets/gnutls.modules create mode 100644 scripts/jhbuild/modulesets/gtk.modules create mode 100644 scripts/jhbuild/modulesets/gtk28.modules create mode 100644 scripts/jhbuild/modulesets/moduleset.dtd create mode 100644 scripts/jhbuild/modulesets/moduleset.rnc create mode 100644 scripts/jhbuild/modulesets/moduleset.xsl create mode 100644 scripts/jhbuild/modulesets/schemas.xml create mode 100644 scripts/jhbuild/modulesets/xorg-7.0.modules create mode 100644 scripts/jhbuild/modulesets/xorg.modules create mode 100644 scripts/lib/bsp/__init__.py create mode 100644 scripts/lib/bsp/engine.py create mode 100644 scripts/lib/bsp/help.py create mode 100644 scripts/lib/bsp/kernel.py create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/.gitignore create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/conf/machine/{{=machine}}.conf create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver == \"y\": }} xorg.conf" create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-graphics/xorg-xserver/{{ if xserver == \"y\": }} xserver-xf86-config_0.1.bbappend" create mode 100644 scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/kernel-list.noinstall create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-non_hardware.cfg" create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-preempt-rt.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-standard.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-tiny.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-user-config.cfg" create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-user-features.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-user-patches.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.cfg" create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-dev\": }} linux-yocto-dev.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.10\": }} linux-yocto-rt_3.10.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-tiny_3.10\": }} linux-yocto-tiny_3.10.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-tiny_3.14\": }} linux-yocto-tiny_3.14.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.10\": }} linux-yocto_3.10.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/arm/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.14\": }} linux-yocto_3.14.bbappend" create mode 100644 scripts/lib/bsp/substrate/target/arch/common/COPYING.MIT create mode 100644 scripts/lib/bsp/substrate/target/arch/common/README create mode 100644 scripts/lib/bsp/substrate/target/arch/common/README.sources create mode 100644 scripts/lib/bsp/substrate/target/arch/common/binary/.gitignore create mode 100644 scripts/lib/bsp/substrate/target/arch/common/conf/layer.conf create mode 100644 scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor/{{=machine}}/machconfig create mode 100644 scripts/lib/bsp/substrate/target/arch/common/recipes-bsp/formfactor/formfactor_0.0.bbappend create mode 100644 scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/kernel-list.noinstall create mode 100644 "scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom.bb" create mode 100644 "scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom/defconfig" create mode 100644 "scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom/{{=machine}}-user-config.cfg" create mode 100644 "scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom/{{=machine}}-user-patches.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom/{{=machine}}.cfg" create mode 100644 "scripts/lib/bsp/substrate/target/arch/common/recipes-kernel/linux/{{ if kernel_choice == \"custom\": }} linux-yocto-custom/{{=machine}}.scc" create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/conf/machine/{{=machine}}.conf create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver == \"y\": }} xorg.conf" create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-graphics/xorg-xserver/{{ if xserver == \"y\": }} xserver-xf86-config_0.1.bbappend" create mode 100644 scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/kernel-list.noinstall create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-preempt-rt.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-standard.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-tiny.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-user-config.cfg" create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-user-features.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-user-patches.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.cfg" create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-dev\": }} linux-yocto-dev.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.10\": }} linux-yocto-rt_3.10.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-tiny_3.10\": }} linux-yocto-tiny_3.10.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-tiny_3.14\": }} linux-yocto-tiny_3.14.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.10\": }} linux-yocto_3.10.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/i386/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.14\": }} linux-yocto_3.14.bbappend" create mode 100644 scripts/lib/bsp/substrate/target/arch/layer/COPYING.MIT create mode 100644 scripts/lib/bsp/substrate/target/arch/layer/README create mode 100644 scripts/lib/bsp/substrate/target/arch/layer/conf/layer.conf create mode 100644 scripts/lib/bsp/substrate/target/arch/layer/layer-questions.noinstall create mode 100644 "scripts/lib/bsp/substrate/target/arch/layer/{{ if create_example_bbappend == \"y\": }} recipes-example-bbappend/example-bbappend/{{=example_bbappend_name}}-{{=example_bbappend_version}}/example.patch" create mode 100644 "scripts/lib/bsp/substrate/target/arch/layer/{{ if create_example_bbappend == \"y\": }} recipes-example-bbappend/example-bbappend/{{=example_bbappend_name}}_{{=example_bbappend_version}}.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/layer/{{ if create_example_recipe == \"y\": }} recipes-example/example/{{=example_recipe_name}}-0.1/example.patch" create mode 100644 "scripts/lib/bsp/substrate/target/arch/layer/{{ if create_example_recipe == \"y\": }} recipes-example/example/{{=example_recipe_name}}-0.1/helloworld.c" create mode 100644 "scripts/lib/bsp/substrate/target/arch/layer/{{ if create_example_recipe == \"y\": }} recipes-example/example/{{=example_recipe_name}}_0.1.bb" create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/.gitignore create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/conf/machine/{{=machine}}.conf create mode 100644 scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/kernel-list.noinstall create mode 100644 "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-preempt-rt.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-standard.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-tiny.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-user-config.cfg" create mode 100644 "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-user-features.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-user-patches.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.cfg" create mode 100644 "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-dev\": }} linux-yocto-dev.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.10\": }} linux-yocto-rt_3.10.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-tiny_3.10\": }} linux-yocto-tiny_3.10.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-tiny_3.14\": }} linux-yocto-tiny_3.14.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.10\": }} linux-yocto_3.10.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/mips/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.14\": }} linux-yocto_3.14.bbappend" create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/.gitignore create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/conf/machine/{{=machine}}.conf create mode 100644 scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/kernel-list.noinstall create mode 100644 "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-preempt-rt.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-standard.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-tiny.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-user-config.cfg" create mode 100644 "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-user-features.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-user-patches.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.cfg" create mode 100644 "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-dev\": }} linux-yocto-dev.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.10\": }} linux-yocto-rt_3.10.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-tiny_3.10\": }} linux-yocto-tiny_3.10.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-tiny_3.14\": }} linux-yocto-tiny_3.14.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.10\": }} linux-yocto_3.10.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/powerpc/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.14\": }} linux-yocto_3.14.bbappend" create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/conf/machine/{{=machine}}.conf create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-core/init-ifupdown/init-ifupdown/{{=machine}}/interfaces create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-core/init-ifupdown/init-ifupdown_1.0.bbappend create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/xorg.conf create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bbappend create mode 100644 scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/kernel-list.noinstall create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-preempt-rt.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-standard.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-tiny.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-user-config.cfg" create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-user-features.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-user-patches.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.cfg" create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-dev\": }} linux-yocto-dev.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.10\": }} linux-yocto-rt_3.10.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-tiny_3.10\": }} linux-yocto-tiny_3.10.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-tiny_3.14\": }} linux-yocto-tiny_3.4.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.10\": }} linux-yocto_3.10.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/qemu/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.14\": }} linux-yocto_3.14.bbappend" create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/.gitignore create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/conf/machine/{{=machine}}.conf create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/xserver-xf86-config/{{=machine}}/{{ if xserver == \"y\": }} xorg.conf" create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-graphics/xorg-xserver/{{ if xserver == \"y\": }} xserver-xf86-config_0.1.bbappend" create mode 100644 scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/kernel-list.noinstall create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-preempt-rt.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-standard.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-tiny.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-user-config.cfg" create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-user-features.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}-user-patches.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.cfg" create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice != \"custom\": }} files/{{=machine}}.scc" create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-dev\": }} linux-yocto-dev.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-rt_3.10\": }} linux-yocto-rt_3.10.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-tiny_3.10\": }} linux-yocto-tiny_3.10.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto-tiny_3.14\": }} linux-yocto-tiny_3.14.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.10\": }} linux-yocto_3.10.bbappend" create mode 100644 "scripts/lib/bsp/substrate/target/arch/x86_64/recipes-kernel/linux/{{ if kernel_choice == \"linux-yocto_3.14\": }} linux-yocto_3.14.bbappend" create mode 100644 scripts/lib/bsp/tags.py create mode 100644 scripts/lib/image/__init__.py create mode 100644 scripts/lib/image/canned-wks/directdisk.wks create mode 100644 scripts/lib/image/canned-wks/mkefidisk.wks create mode 100644 scripts/lib/image/canned-wks/uboot.wks create mode 100644 scripts/lib/image/config/wic.conf create mode 100644 scripts/lib/image/engine.py create mode 100644 scripts/lib/image/help.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/__init__.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/base.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/__init__.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/authconfig.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/autopart.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/autostep.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/bootloader.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/clearpart.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/device.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/deviceprobe.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/displaymode.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/dmraid.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/driverdisk.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/fcoe.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/firewall.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/firstboot.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/group.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/ignoredisk.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/interactive.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/iscsi.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/iscsiname.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/key.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/keyboard.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/lang.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/langsupport.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/lilocheck.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/logging.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/logvol.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/mediacheck.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/method.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/monitor.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/mouse.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/multipath.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/network.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/partition.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/raid.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/reboot.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/repo.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/rescue.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/rootpw.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/selinux.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/services.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/skipx.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/sshpw.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/timezone.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/updates.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/upgrade.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/user.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/vnc.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/volgroup.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/xconfig.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/zerombr.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/zfcp.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/constants.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/errors.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/__init__.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/control.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/f10.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/f11.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/f12.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/f13.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/f14.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/f15.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/f16.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/f7.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/f8.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/f9.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/fc3.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/fc4.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/fc5.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/fc6.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/rhel3.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/rhel4.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/rhel5.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/handlers/rhel6.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/ko.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/options.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/parser.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/sections.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/urlgrabber/__init__.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/urlgrabber/byterange.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/urlgrabber/grabber.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/urlgrabber/keepalive.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/urlgrabber/mirror.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/urlgrabber/progress.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/urlgrabber/sslfactory.py create mode 100644 scripts/lib/mic/3rdparty/pykickstart/version.py create mode 100644 scripts/lib/mic/__init__.py create mode 100644 scripts/lib/mic/__version__.py create mode 100644 scripts/lib/mic/bootstrap.py create mode 100644 scripts/lib/mic/chroot.py create mode 100644 scripts/lib/mic/conf.py create mode 100644 scripts/lib/mic/creator.py create mode 100644 scripts/lib/mic/imager/__init__.py create mode 100644 scripts/lib/mic/imager/baseimager.py create mode 100644 scripts/lib/mic/imager/direct.py create mode 100644 scripts/lib/mic/imager/fs.py create mode 100644 scripts/lib/mic/imager/livecd.py create mode 100644 scripts/lib/mic/imager/liveusb.py create mode 100644 scripts/lib/mic/imager/loop.py create mode 100644 scripts/lib/mic/imager/raw.py create mode 100644 scripts/lib/mic/kickstart/__init__.py create mode 100644 scripts/lib/mic/kickstart/custom_commands/__init__.py create mode 100644 scripts/lib/mic/kickstart/custom_commands/desktop.py create mode 100644 scripts/lib/mic/kickstart/custom_commands/installerfw.py create mode 100644 scripts/lib/mic/kickstart/custom_commands/micboot.py create mode 100644 scripts/lib/mic/kickstart/custom_commands/micpartition.py create mode 100644 scripts/lib/mic/kickstart/custom_commands/micrepo.py create mode 100644 scripts/lib/mic/kickstart/custom_commands/partition.py create mode 100644 scripts/lib/mic/kickstart/custom_commands/wicboot.py create mode 100644 scripts/lib/mic/msger.py create mode 100644 scripts/lib/mic/plugin.py create mode 100644 scripts/lib/mic/pluginbase.py create mode 100644 scripts/lib/mic/plugins/backend/yumpkgmgr.py create mode 100755 scripts/lib/mic/plugins/backend/zypppkgmgr.py create mode 100644 scripts/lib/mic/plugins/hook/.py create mode 100644 scripts/lib/mic/plugins/hook/empty_hook.py create mode 100644 scripts/lib/mic/plugins/imager/direct_plugin.py create mode 100644 scripts/lib/mic/plugins/imager/fs_plugin.py create mode 100644 scripts/lib/mic/plugins/imager/livecd_plugin.py create mode 100644 scripts/lib/mic/plugins/imager/liveusb_plugin.py create mode 100644 scripts/lib/mic/plugins/imager/loop_plugin.py create mode 100644 scripts/lib/mic/plugins/imager/raw_plugin.py create mode 100644 scripts/lib/mic/plugins/source/bootimg-efi.py create mode 100644 scripts/lib/mic/plugins/source/bootimg-pcbios.py create mode 100644 scripts/lib/mic/plugins/source/rootfs.py create mode 100644 scripts/lib/mic/plugins/source/uboot.py create mode 100644 scripts/lib/mic/rt_util.py create mode 100644 scripts/lib/mic/test create mode 100644 scripts/lib/mic/utils/BmapCreate.py create mode 100644 scripts/lib/mic/utils/Fiemap.py create mode 100644 scripts/lib/mic/utils/__init__.py create mode 100644 scripts/lib/mic/utils/cmdln.py create mode 100644 scripts/lib/mic/utils/errors.py create mode 100644 scripts/lib/mic/utils/fs_related.py create mode 100644 scripts/lib/mic/utils/gpt_parser.py create mode 100644 scripts/lib/mic/utils/grabber.py create mode 100644 scripts/lib/mic/utils/misc.py create mode 100644 scripts/lib/mic/utils/oe/__init__.py create mode 100644 scripts/lib/mic/utils/oe/misc.py create mode 100644 scripts/lib/mic/utils/oe/package_manager.py create mode 100644 scripts/lib/mic/utils/partitionedfs.py create mode 100644 scripts/lib/mic/utils/proxy.py create mode 100644 scripts/lib/mic/utils/rpmmisc.py create mode 100644 scripts/lib/mic/utils/runner.py create mode 100755 scripts/lnr create mode 100644 scripts/multilib_header_wrapper.h create mode 100755 scripts/native-intercept/chown create mode 100755 scripts/oe-buildenv-internal create mode 100755 scripts/oe-find-native-sysroot create mode 100755 scripts/oe-git-proxy create mode 100755 scripts/oe-pkgdata-util create mode 100755 scripts/oe-selftest create mode 100755 scripts/oe-setup-builddir create mode 100755 scripts/oe-setup-rpmrepo create mode 100755 scripts/oe-trim-schemas create mode 100755 scripts/opkg-query-helper.py create mode 100755 scripts/postinst-intercepts/postinst_intercept create mode 100644 scripts/postinst-intercepts/update_font_cache create mode 100644 scripts/postinst-intercepts/update_icon_cache create mode 100644 scripts/postinst-intercepts/update_pixbuf_cache create mode 100644 scripts/pybootchartgui/AUTHORS create mode 100644 scripts/pybootchartgui/COPYING create mode 100644 scripts/pybootchartgui/MAINTAINERS create mode 100644 scripts/pybootchartgui/NEWS create mode 100644 scripts/pybootchartgui/README.pybootchart create mode 100755 scripts/pybootchartgui/pybootchartgui.py create mode 100644 scripts/pybootchartgui/pybootchartgui/__init__.py create mode 100644 scripts/pybootchartgui/pybootchartgui/batch.py create mode 100644 scripts/pybootchartgui/pybootchartgui/draw.py create mode 100644 scripts/pybootchartgui/pybootchartgui/gui.py create mode 120000 scripts/pybootchartgui/pybootchartgui/main.py create mode 100644 scripts/pybootchartgui/pybootchartgui/main.py.in create mode 100644 scripts/pybootchartgui/pybootchartgui/parsing.py create mode 100644 scripts/pybootchartgui/pybootchartgui/process_tree.py create mode 100644 scripts/pybootchartgui/pybootchartgui/samples.py create mode 100644 scripts/pybootchartgui/pybootchartgui/tests/parser_test.py create mode 100644 scripts/pybootchartgui/pybootchartgui/tests/process_tree_test.py create mode 100755 scripts/relocate_sdk.py create mode 100644 scripts/rootfs_rpm-extract-postinst.awk create mode 100755 scripts/rpm2cpio.sh create mode 100755 scripts/runqemu create mode 100755 scripts/runqemu-addptable2image create mode 100755 scripts/runqemu-export-rootfs create mode 100755 scripts/runqemu-extract-sdk create mode 100755 scripts/runqemu-gen-tapdevs create mode 100755 scripts/runqemu-ifdown create mode 100755 scripts/runqemu-ifup create mode 100755 scripts/runqemu-internal create mode 100644 scripts/runqemu.README create mode 100755 scripts/send-error-report create mode 100755 scripts/send-pull-request create mode 100755 scripts/sstate-cache-management.sh create mode 100755 scripts/sstate-diff-machines.sh create mode 100755 scripts/sstate-sysroot-cruft.sh create mode 100755 scripts/swabber-strace-attach create mode 100755 scripts/sysroot-relativelinks.py create mode 100755 scripts/test-dependencies.sh create mode 100755 scripts/test-reexec create mode 100755 scripts/tiny/dirsize.py create mode 100755 scripts/tiny/ksize.py create mode 100755 scripts/wic create mode 100755 scripts/wipe-sysroot create mode 100755 scripts/yocto-bsp create mode 100755 scripts/yocto-kernel create mode 100755 scripts/yocto-layer (limited to 'scripts') diff --git a/scripts/README b/scripts/README new file mode 100644 index 0000000000..1b8d127245 --- /dev/null +++ b/scripts/README @@ -0,0 +1 @@ +This directory contains Various useful scripts for working with OE builds diff --git a/scripts/bitbake-prserv-tool b/scripts/bitbake-prserv-tool new file mode 100755 index 0000000000..28c2416bfe --- /dev/null +++ b/scripts/bitbake-prserv-tool @@ -0,0 +1,103 @@ +#!/usr/bin/env bash + +help () +{ + base=`basename $0` + echo -e "Usage: $base command" + echo "Avaliable commands:" + echo -e "\texport : export and lock down the AUTOPR values from the PR service into a file for release." + echo -e "\timport : import the AUTOPR values from the exported file into the PR service." +} + +clean_cache() +{ + s=`bitbake -e | grep ^CACHE= | cut -f2 -d\"` + if [ "x${s}" != "x" ]; then + rm -rf ${s} + fi +} + +do_export () +{ + file=$1 + [ "x${file}" == "x" ] && help && exit 1 + rm -f ${file} + + clean_cache + bitbake -R conf/prexport.conf -p + s=`bitbake -R conf/prexport.conf -e | grep ^PRSERV_DUMPFILE= | cut -f2 -d\"` + if [ "x${s}" != "x" ]; + then + [ -e $s ] && mv -f $s $file && echo "Exporting to file $file succeeded!" + return 0 + fi + echo "Exporting to file $file failed!" + return 1 +} + +do_import () +{ + file=$1 + [ "x${file}" == "x" ] && help && exit 1 + + clean_cache + bitbake -R conf/primport.conf -R $file -p + ret=$? + [ $ret -eq 0 ] && echo "Importing from file $file succeeded!" || echo "Importing from file $file failed!" + return $ret +} + +do_migrate_localcount () +{ + df=`bitbake -R conf/migrate_localcount.conf -e | \ + grep ^LOCALCOUNT_DUMPFILE= | cut -f2 -d\"` + if [ "x${df}" == "x" ]; + then + echo "LOCALCOUNT_DUMPFILE is not defined!" + return 1 + fi + + rm -rf $df + clean_cache + echo "Exporting LOCALCOUNT to AUTOINCs..." + bitbake -R conf/migrate_localcount.conf -p + [ ! $? -eq 0 ] && echo "Exporting to file $df failed!" && exit 1 + + if [ -e $df ]; + then + echo "Exporting to file $df succeeded!" + else + echo "Exporting to file $df failed!" + exit 1 + fi + + echo "Importing generated AUTOINC entries..." + [ -e $df ] && do_import $df + + if [ ! $? -eq 0 ] + then + echo "Migration from LOCALCOUNT to AUTOINCs failed!" + return 1 + fi + + echo "Migration from LOCALCOUNT to AUTOINCs succeeded!" + return 0 +} + +[ $# -eq 0 ] && help && exit 1 + +case $1 in +export) + do_export $2 + ;; +import) + do_import $2 + ;; +migrate_localcount) + do_migrate_localcount + ;; +*) + help + exit 1 + ;; +esac diff --git a/scripts/bitbake-whatchanged b/scripts/bitbake-whatchanged new file mode 100755 index 0000000000..e4497e03a8 --- /dev/null +++ b/scripts/bitbake-whatchanged @@ -0,0 +1,339 @@ +#!/usr/bin/env python +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- + +# Copyright (c) 2013 Wind River Systems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +from __future__ import print_function +import os +import sys +import getopt +import shutil +import re +import warnings +import subprocess +from optparse import OptionParser + +# Figure out where is the bitbake/lib/bb since we need bb.siggen and bb.process +p = subprocess.Popen("bash -c 'echo $(dirname $(which bitbake-diffsigs | grep -v \'^alias\'))/../lib'", + shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + +err = p.stderr.read() +if err: + print("ERROR: Failed to locate bitbake-diffsigs:", file=sys.stderr) + print(err, file=sys.stderr) + sys.exit(1) + +sys.path.insert(0, p.stdout.read().rstrip('\n')) + +import bb.siggen +import bb.process + +# Match the stamp's filename +# group(1): PE_PV (may no PE) +# group(2): PR +# group(3): TASK +# group(4): HASH +stamp_re = re.compile("(?P.*)-(?Pr\d+)\.(?Pdo_\w+)\.(?P[^\.]*)") +sigdata_re = re.compile(".*\.sigdata\..*") + +def gen_dict(stamps): + """ + Generate the dict from the stamps dir. + The output dict format is: + {fake_f: {pn: PN, pv: PV, pr: PR, task: TASK, path: PATH}} + Where: + fake_f: pv + task + hash + path: the path to the stamp file + """ + # The member of the sub dict (A "path" will be appended below) + sub_mem = ("pv", "pr", "task") + d = {} + for dirpath, _, files in os.walk(stamps): + for f in files: + # The "bitbake -S" would generate ".sigdata", but no "_setscene". + fake_f = re.sub('_setscene.', '.', f) + fake_f = re.sub('.sigdata', '', fake_f) + subdict = {} + tmp = stamp_re.match(fake_f) + if tmp: + for i in sub_mem: + subdict[i] = tmp.group(i) + if len(subdict) != 0: + pn = os.path.basename(dirpath) + subdict['pn'] = pn + # The path will be used by os.stat() and bb.siggen + subdict['path'] = dirpath + "/" + f + fake_f = tmp.group('pv') + tmp.group('task') + tmp.group('hash') + d[fake_f] = subdict + return d + +# Re-construct the dict +def recon_dict(dict_in): + """ + The output dict format is: + {pn_task: {pv: PV, pr: PR, path: PATH}} + """ + dict_out = {} + for k in dict_in.keys(): + subdict = {} + # The key + pn_task = "%s_%s" % (dict_in.get(k).get('pn'), dict_in.get(k).get('task')) + # If more than one stamps are found, use the latest one. + if pn_task in dict_out: + full_path_pre = dict_out.get(pn_task).get('path') + full_path_cur = dict_in.get(k).get('path') + if os.stat(full_path_pre).st_mtime > os.stat(full_path_cur).st_mtime: + continue + subdict['pv'] = dict_in.get(k).get('pv') + subdict['pr'] = dict_in.get(k).get('pr') + subdict['path'] = dict_in.get(k).get('path') + dict_out[pn_task] = subdict + + return dict_out + +def split_pntask(s): + """ + Split the pn_task in to (pn, task) and return it + """ + tmp = re.match("(.*)_(do_.*)", s) + return (tmp.group(1), tmp.group(2)) + + +def print_added(d_new = None, d_old = None): + """ + Print the newly added tasks + """ + added = {} + for k in d_new.keys(): + if k not in d_old: + # Add the new one to added dict, and remove it from + # d_new, so the remaining ones are the changed ones + added[k] = d_new.get(k) + del(d_new[k]) + + if not added: + return 0 + + # Format the output, the dict format is: + # {pn: task1, task2 ...} + added_format = {} + counter = 0 + for k in added.keys(): + pn, task = split_pntask(k) + if pn in added_format: + # Append the value + added_format[pn] = "%s %s" % (added_format.get(pn), task) + else: + added_format[pn] = task + counter += 1 + print("=== Newly added tasks: (%s tasks)" % counter) + for k in added_format.keys(): + print(" %s: %s" % (k, added_format.get(k))) + + return counter + +def print_vrchanged(d_new = None, d_old = None, vr = None): + """ + Print the pv or pr changed tasks. + The arg "vr" is "pv" or "pr" + """ + pvchanged = {} + counter = 0 + for k in d_new.keys(): + if d_new.get(k).get(vr) != d_old.get(k).get(vr): + counter += 1 + pn, task = split_pntask(k) + if pn not in pvchanged: + # Format the output, we only print pn (no task) since + # all the tasks would be changed when pn or pr changed, + # the dict format is: + # {pn: pv/pr_old -> pv/pr_new} + pvchanged[pn] = "%s -> %s" % (d_old.get(k).get(vr), d_new.get(k).get(vr)) + del(d_new[k]) + + if not pvchanged: + return 0 + + print("\n=== %s changed: (%s tasks)" % (vr.upper(), counter)) + for k in pvchanged.keys(): + print(" %s: %s" % (k, pvchanged.get(k))) + + return counter + +def print_depchanged(d_new = None, d_old = None, verbose = False): + """ + Print the dependency changes + """ + depchanged = {} + counter = 0 + for k in d_new.keys(): + counter += 1 + pn, task = split_pntask(k) + if (verbose): + full_path_old = d_old.get(k).get("path") + full_path_new = d_new.get(k).get("path") + # No counter since it is not ready here + if sigdata_re.match(full_path_old) and sigdata_re.match(full_path_new): + output = bb.siggen.compare_sigfiles(full_path_old, full_path_new) + if output: + print("\n=== The verbose changes of %s.do_%s:" % (pn, task)) + print('\n'.join(output)) + else: + # Format the output, the format is: + # {pn: task1, task2, ...} + if pn in depchanged: + depchanged[pn] = "%s %s" % (depchanged.get(pn), task) + else: + depchanged[pn] = task + + if len(depchanged) > 0: + print("\n=== Dependencies changed: (%s tasks)" % counter) + for k in depchanged.keys(): + print(" %s: %s" % (k, depchanged[k])) + + return counter + + +def main(): + """ + Print what will be done between the current and last builds: + 1) Run "STAMPS_DIR= bitbake -S recipe" to re-generate the stamps + 2) Figure out what are newly added and changed, can't figure out + what are removed since we can't know the previous stamps + clearly, for example, if there are several builds, we can't know + which stamps the last build has used exactly. + 3) Use bb.siggen.compare_sigfiles to diff the old and new stamps + """ + + parser = OptionParser( + version = "1.0", + usage = """%prog [options] [package ...] +print what will be done between the current and last builds, for example: + + $ bitbake core-image-sato + # Edit the recipes + $ bitbake-whatchanged core-image-sato + +The changes will be printed" + +Note: + The amount of tasks is not accurate when the task is "do_build" since + it usually depends on other tasks. + The "nostamp" task is not included. +""" +) + parser.add_option("-v", "--verbose", help = "print the verbose changes", + action = "store_true", dest = "verbose") + + options, args = parser.parse_args(sys.argv) + + verbose = options.verbose + + if len(args) != 2: + parser.error("Incorrect number of arguments") + else: + recipe = args[1] + + # Get the STAMPS_DIR + print("Figuring out the STAMPS_DIR ...") + cmdline = "bitbake -e | sed -ne 's/^STAMPS_DIR=\"\(.*\)\"/\\1/p'" + try: + stampsdir, err = bb.process.run(cmdline) + except: + raise + if not stampsdir: + print("ERROR: No STAMPS_DIR found for '%s'" % recipe, file=sys.stderr) + return 2 + stampsdir = stampsdir.rstrip("\n") + if not os.path.isdir(stampsdir): + print("ERROR: stamps directory \"%s\" not found!" % stampsdir, file=sys.stderr) + return 2 + + # The new stamps dir + new_stampsdir = stampsdir + ".bbs" + if os.path.exists(new_stampsdir): + print("ERROR: %s already exists!" % new_stampsdir, file=sys.stderr) + return 2 + + try: + # Generate the new stamps dir + print("Generating the new stamps ... (need several minutes)") + cmdline = "STAMPS_DIR=%s bitbake -S none %s" % (new_stampsdir, recipe) + # FIXME + # The "bitbake -S" may fail, not fatal error, the stamps will still + # be generated, this might be a bug of "bitbake -S". + try: + bb.process.run(cmdline) + except Exception as exc: + print(exc) + + # The dict for the new and old stamps. + old_dict = gen_dict(stampsdir) + new_dict = gen_dict(new_stampsdir) + + # Remove the same one from both stamps. + cnt_unchanged = 0 + for k in new_dict.keys(): + if k in old_dict: + cnt_unchanged += 1 + del(new_dict[k]) + del(old_dict[k]) + + # Re-construct the dict to easily find out what is added or changed. + # The dict format is: + # {pn_task: {pv: PV, pr: PR, path: PATH}} + new_recon = recon_dict(new_dict) + old_recon = recon_dict(old_dict) + + del new_dict + del old_dict + + # Figure out what are changed, the new_recon would be changed + # by the print_xxx function. + # Newly added + cnt_added = print_added(new_recon, old_recon) + + # PV (including PE) and PR changed + # Let the bb.siggen handle them if verbose + cnt_rv = {} + if not verbose: + for i in ('pv', 'pr'): + cnt_rv[i] = print_vrchanged(new_recon, old_recon, i) + + # Dependencies changed (use bitbake-diffsigs) + cnt_dep = print_depchanged(new_recon, old_recon, verbose) + + total_changed = cnt_added + (cnt_rv.get('pv') or 0) + (cnt_rv.get('pr') or 0) + cnt_dep + + print("\n=== Summary: (%s changed, %s unchanged)" % (total_changed, cnt_unchanged)) + if verbose: + print("Newly added: %s\nDependencies changed: %s\n" % \ + (cnt_added, cnt_dep)) + else: + print("Newly added: %s\nPV changed: %s\nPR changed: %s\nDependencies changed: %s\n" % \ + (cnt_added, cnt_rv.get('pv') or 0, cnt_rv.get('pr') or 0, cnt_dep)) + except: + print("ERROR occurred!") + raise + finally: + # Remove the newly generated stamps dir + if os.path.exists(new_stampsdir): + print("Removing the newly generated stamps dir ...") + shutil.rmtree(new_stampsdir) + +if __name__ == "__main__": + sys.exit(main()) diff --git a/scripts/buildhistory-collect-srcrevs b/scripts/buildhistory-collect-srcrevs new file mode 100755 index 0000000000..58a2708032 --- /dev/null +++ b/scripts/buildhistory-collect-srcrevs @@ -0,0 +1,109 @@ +#!/usr/bin/env python +# +# Collects the recorded SRCREV values from buildhistory and reports on them +# +# Copyright 2013 Intel Corporation +# Authored-by: Paul Eggleton +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +import os, sys +import optparse +import logging + +def logger_create(): + logger = logging.getLogger("buildhistory") + loggerhandler = logging.StreamHandler() + loggerhandler.setFormatter(logging.Formatter("%(levelname)s: %(message)s")) + logger.addHandler(loggerhandler) + logger.setLevel(logging.INFO) + return logger + +logger = logger_create() + +def main(): + parser = optparse.OptionParser( + description = "Collects the recorded SRCREV values from buildhistory and reports on them.", + usage = """ + %prog [options]""") + + parser.add_option("-a", "--report-all", + help = "Report all SRCREV values, not just ones where AUTOREV has been used", + action="store_true", dest="reportall") + parser.add_option("-f", "--forcevariable", + help = "Use forcevariable override for all output lines", + action="store_true", dest="forcevariable") + parser.add_option("-p", "--buildhistory-dir", + help = "Specify path to buildhistory directory (defaults to buildhistory/ under cwd)", + action="store", dest="buildhistory_dir", default='buildhistory/') + + options, args = parser.parse_args(sys.argv) + + if len(args) > 1: + sys.stderr.write('Invalid argument(s) specified: %s\n\n' % ' '.join(args[1:])) + parser.print_help() + sys.exit(1) + + if not os.path.exists(options.buildhistory_dir): + sys.stderr.write('Buildhistory directory "%s" does not exist\n\n' % options.buildhistory_dir) + parser.print_help() + sys.exit(1) + + if options.forcevariable: + forcevariable = '_forcevariable' + else: + forcevariable = '' + + lastdir = '' + for root, dirs, files in os.walk(options.buildhistory_dir): + if '.git' in dirs: + dirs.remove('.git') + for fn in files: + if fn == 'latest_srcrev': + curdir = os.path.basename(os.path.dirname(root)) + if lastdir != curdir: + print('# %s' % curdir) + lastdir = curdir + fullpath = os.path.join(root, fn) + pn = os.path.basename(root) + srcrev = None + orig_srcrev = None + orig_srcrevs = {} + srcrevs = {} + with open(fullpath) as f: + for line in f: + if '=' in line: + splitval = line.split('=') + value = splitval[1].strip('" \t\n\r') + if line.startswith('# SRCREV = '): + orig_srcrev = value + elif line.startswith('# SRCREV_'): + splitval = line.split('=') + name = splitval[0].split('_')[1].strip() + orig_srcrevs[name] = value + elif line.startswith('SRCREV ='): + srcrev = value + elif line.startswith('SRCREV_'): + name = splitval[0].split('_')[1].strip() + srcrevs[name] = value + if srcrev and (options.reportall or srcrev != orig_srcrev): + print('SRCREV_pn-%s%s = "%s"' % (pn, forcevariable, srcrev)) + for name, value in srcrevs.items(): + orig = orig_srcrevs.get(name, orig_srcrev) + if options.reportall or value != orig: + print('SRCREV_%s_pn-%s%s = "%s"' % (name, pn, forcevariable, value)) + + +if __name__ == "__main__": + main() diff --git a/scripts/buildhistory-diff b/scripts/buildhistory-diff new file mode 100755 index 0000000000..ad50414bce --- /dev/null +++ b/scripts/buildhistory-diff @@ -0,0 +1,104 @@ +#!/usr/bin/env python + +# Report significant differences in the buildhistory repository since a specific revision +# +# Copyright (C) 2013 Intel Corporation +# Author: Paul Eggleton + +import sys +import os +import optparse +from distutils.version import LooseVersion + +# Ensure PythonGit is installed (buildhistory_analysis needs it) +try: + import git +except ImportError: + print("Please install GitPython (python-git) 0.3.1 or later in order to use this script") + sys.exit(1) + +def main(): + parser = optparse.OptionParser( + description = "Reports significant differences in the buildhistory repository.", + usage = """ + %prog [options] [from-revision [to-revision]] +(if not specified, from-revision defaults to build-minus-1, and to-revision defaults to HEAD)""") + + parser.add_option("-p", "--buildhistory-dir", + help = "Specify path to buildhistory directory (defaults to buildhistory/ under cwd)", + action="store", dest="buildhistory_dir", default='buildhistory/') + parser.add_option("-v", "--report-version", + help = "Report changes in PKGE/PKGV/PKGR even when the values are still the default (PE/PV/PR)", + action="store_true", dest="report_ver", default=False) + parser.add_option("-a", "--report-all", + help = "Report all changes, not just the default significant ones", + action="store_true", dest="report_all", default=False) + + options, args = parser.parse_args(sys.argv) + + if len(args) > 3: + sys.stderr.write('Invalid argument(s) specified: %s\n\n' % ' '.join(args[3:])) + parser.print_help() + sys.exit(1) + + if LooseVersion(git.__version__) < '0.3.1': + sys.stderr.write("Version of GitPython is too old, please install GitPython (python-git) 0.3.1 or later in order to use this script\n") + sys.exit(1) + + if not os.path.exists(options.buildhistory_dir): + sys.stderr.write('Buildhistory directory "%s" does not exist\n\n' % options.buildhistory_dir) + parser.print_help() + sys.exit(1) + + # Set path to OE lib dir so we can import the buildhistory_analysis module + basepath = os.path.abspath(os.path.dirname(os.path.abspath(sys.argv[0])) + '/..') + newpath = basepath + '/meta/lib' + # Set path to bitbake lib dir so the buildhistory_analysis module can load bb.utils + if os.path.exists(basepath + '/bitbake/lib/bb'): + bitbakepath = basepath + '/bitbake' + else: + # look for bitbake/bin dir in PATH + bitbakepath = None + for pth in os.environ['PATH'].split(':'): + if os.path.exists(os.path.join(pth, '../lib/bb')): + bitbakepath = os.path.abspath(os.path.join(pth, '..')) + break + if not bitbakepath: + sys.stderr.write("Unable to find bitbake by searching parent directory of this script or PATH\n") + sys.exit(1) + + sys.path[0:0] = [newpath, bitbakepath + '/lib'] + import oe.buildhistory_analysis + + fromrev = 'build-minus-1' + torev = 'HEAD' + if len(args) > 1: + if len(args) == 2 and '..' in args[1]: + revs = args[1].split('..') + fromrev = revs[0] + if revs[1]: + torev = revs[1] + else: + fromrev = args[1] + if len(args) > 2: + torev = args[2] + + import gitdb + try: + changes = oe.buildhistory_analysis.process_changes(options.buildhistory_dir, fromrev, torev, options.report_all, options.report_ver) + except gitdb.exc.BadObject as e: + if len(args) == 1: + sys.stderr.write("Unable to find previous build revision in buildhistory repository\n\n") + parser.print_help() + else: + sys.stderr.write('Specified git revision "%s" is not valid\n' % e.args[0]) + sys.exit(1) + + for chg in changes: + print('%s' % chg) + + sys.exit(0) + + +if __name__ == "__main__": + main() diff --git a/scripts/cleanup-workdir b/scripts/cleanup-workdir new file mode 100755 index 0000000000..25fef976b6 --- /dev/null +++ b/scripts/cleanup-workdir @@ -0,0 +1,194 @@ +#!/usr/bin/env python + +# Copyright (c) 2012 Wind River Systems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +import os +import sys +import optparse +import re +import subprocess +import shutil + +pkg_cur_dirs = {} +obsolete_dirs = [] +parser = None + +def err_quit(msg): + print msg + parser.print_usage() + sys.exit(1) + +def parse_version(verstr): + elems = verstr.split(':') + epoch = elems[0] + if len(epoch) == 0: + return elems[1] + else: + return epoch + '_' + elems[1] + +def run_command(cmd): + pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True) + output = pipe.communicate()[0] + if pipe.returncode != 0: + print "Execute command '%s' failed." % cmd + sys.exit(1) + return output + +def get_cur_arch_dirs(workdir, arch_dirs): + pattern = workdir + '/(.*?)/' + + # select thest 5 packages to get the dirs of current arch + pkgs = ['hicolor-icon-theme', 'base-files', 'acl-native', 'binutils-crosssdk', 'nativesdk-autoconf'] + + for pkg in pkgs: + cmd = "bitbake -e " + pkg + " | grep ^IMAGE_ROOTFS=" + output = run_command(cmd) + output = output.split('"')[1] + m = re.match(pattern, output) + arch_dirs.append(m.group(1)) + +def main(): + global parser + parser = optparse.OptionParser( + usage = """%prog + +%prog removes the obsolete packages' build directories in WORKDIR. +This script must be ran under BUILDDIR after source file \"oe-init-build-env\". + +Any file or directory under WORKDIR which is not created by Yocto +will be deleted. Be CAUTIOUS.""") + + options, args = parser.parse_args(sys.argv) + + builddir = run_command('echo $BUILDDIR').strip() + if len(builddir) == 0: + err_quit("Please source file \"oe-init-build-env\" first.\n") + + if os.getcwd() != builddir: + err_quit("Please run %s under: %s\n" % (os.path.basename(args[0]), builddir)) + + print 'Updating bitbake caches...' + cmd = "bitbake -s" + output = run_command(cmd) + + output = output.split('\n') + index = 0 + while len(output[index]) > 0: + index += 1 + alllines = output[index+1:] + + for line in alllines: + # empty again means end of the versions output + if len(line) == 0: + break + line = line.strip() + line = re.sub('\s+', ' ', line) + elems = line.split(' ') + if len(elems) == 2: + version = parse_version(elems[1]) + else: + version = parse_version(elems[2]) + pkg_cur_dirs[elems[0]] = version + + cmd = "bitbake -e" + output = run_command(cmd) + + tmpdir = None + image_rootfs = None + output = output.split('\n') + for line in output: + if tmpdir and image_rootfs: + break + + if not tmpdir: + m = re.match('TMPDIR="(.*)"', line) + if m: + tmpdir = m.group(1) + + if not image_rootfs: + m = re.match('IMAGE_ROOTFS="(.*)"', line) + if m: + image_rootfs = m.group(1) + + # won't fail just in case + if not tmpdir or not image_rootfs: + print "Can't get TMPDIR or IMAGE_ROOTFS." + return 1 + + pattern = tmpdir + '/(.*?)/(.*?)/' + m = re.match(pattern, image_rootfs) + if not m: + print "Can't get WORKDIR." + return 1 + + workdir = os.path.join(tmpdir, m.group(1)) + + # we only deal the dirs of current arch, total numbers of dirs are 6 + cur_arch_dirs = [m.group(2)] + get_cur_arch_dirs(workdir, cur_arch_dirs) + + for workroot, dirs, files in os.walk(workdir): + # For the files, they should NOT exist in WORKDIR. Remove them. + for f in files: + obsolete_dirs.append(os.path.join(workroot, f)) + + for d in dirs: + if d not in cur_arch_dirs: + continue + + for pkgroot, pkgdirs, filenames in os.walk(os.path.join(workroot, d)): + for f in filenames: + obsolete_dirs.append(os.path.join(pkgroot, f)) + + for pkgdir in sorted(pkgdirs): + if pkgdir not in pkg_cur_dirs: + obsolete_dirs.append(os.path.join(pkgroot, pkgdir)) + else: + for verroot, verdirs, verfiles in os.walk(os.path.join(pkgroot, pkgdir)): + for f in verfiles: + obsolete_dirs.append(os.path.join(pkgroot, f)) + for v in sorted(verdirs): + if v not in pkg_cur_dirs[pkgdir]: + obsolete_dirs.append(os.path.join(pkgroot, pkgdir, v)) + break + + # just process the top dir of every package under tmp/work/*/, + # then jump out of the above os.walk() + break + + # it is convenient to use os.walk() to get dirs and files at same time + # both of them have been dealed in the loop, so jump out + break + + for d in obsolete_dirs: + print "Deleting %s" % d + shutil.rmtree(d, True) + + if len(obsolete_dirs): + print '\nTotal %d items.' % len(obsolete_dirs) + else: + print '\nNo obsolete directory found under %s.' % workdir + + return 0 + +if __name__ == '__main__': + try: + ret = main() + except Exception: + ret = 2 + import traceback + traceback.print_exc(3) + sys.exit(ret) diff --git a/scripts/combo-layer b/scripts/combo-layer new file mode 100755 index 0000000000..9da1d3a89e --- /dev/null +++ b/scripts/combo-layer @@ -0,0 +1,600 @@ +#!/usr/bin/env python +# ex:ts=4:sw=4:sts=4:et +# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- +# +# Copyright 2011 Intel Corporation +# Authored-by: Yu Ke +# Paul Eggleton +# Richard Purdie +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +import os, sys +import optparse +import logging +import subprocess +import ConfigParser +import re + +__version__ = "0.2.1" + +def logger_create(): + logger = logging.getLogger("") + loggerhandler = logging.StreamHandler() + loggerhandler.setFormatter(logging.Formatter("[%(asctime)s] %(message)s","%H:%M:%S")) + logger.addHandler(loggerhandler) + logger.setLevel(logging.INFO) + return logger + +logger = logger_create() + +def get_current_branch(repodir=None): + try: + if not os.path.exists(os.path.join(repodir if repodir else '', ".git")): + # Repo not created yet (i.e. during init) so just assume master + return "master" + branchname = runcmd("git symbolic-ref HEAD 2>/dev/null", repodir).strip() + if branchname.startswith("refs/heads/"): + branchname = branchname[11:] + return branchname + except subprocess.CalledProcessError: + return "" + +class Configuration(object): + """ + Manages the configuration + + For an example config file, see combo-layer.conf.example + + """ + def __init__(self, options): + for key, val in options.__dict__.items(): + setattr(self, key, val) + + def readsection(parser, section, repo): + for (name, value) in parser.items(section): + if value.startswith("@"): + self.repos[repo][name] = eval(value.strip("@")) + else: + self.repos[repo][name] = value + + logger.debug("Loading config file %s" % self.conffile) + self.parser = ConfigParser.ConfigParser() + with open(self.conffile) as f: + self.parser.readfp(f) + + self.repos = {} + for repo in self.parser.sections(): + self.repos[repo] = {} + readsection(self.parser, repo, repo) + + # Load local configuration, if available + self.localconffile = None + self.localparser = None + self.combobranch = None + if self.conffile.endswith('.conf'): + lcfile = self.conffile.replace('.conf', '-local.conf') + if os.path.exists(lcfile): + # Read combo layer branch + self.combobranch = get_current_branch() + logger.debug("Combo layer branch is %s" % self.combobranch) + + self.localconffile = lcfile + logger.debug("Loading local config file %s" % self.localconffile) + self.localparser = ConfigParser.ConfigParser() + with open(self.localconffile) as f: + self.localparser.readfp(f) + + for section in self.localparser.sections(): + if '|' in section: + sectionvals = section.split('|') + repo = sectionvals[0] + if sectionvals[1] != self.combobranch: + continue + else: + repo = section + if repo in self.repos: + readsection(self.localparser, section, repo) + + def update(self, repo, option, value, initmode=False): + if self.localparser: + parser = self.localparser + section = "%s|%s" % (repo, self.combobranch) + conffile = self.localconffile + if initmode and not parser.has_section(section): + parser.add_section(section) + else: + parser = self.parser + section = repo + conffile = self.conffile + parser.set(section, option, value) + with open(conffile, "w") as f: + parser.write(f) + + def sanity_check(self, initmode=False): + required_options=["src_uri", "local_repo_dir", "dest_dir", "last_revision"] + if initmode: + required_options.remove("last_revision") + msg = "" + missing_options = [] + for name in self.repos: + for option in required_options: + if option not in self.repos[name]: + msg = "%s\nOption %s is not defined for component %s" %(msg, option, name) + missing_options.append(option) + if msg != "": + logger.error("configuration file %s has the following error: %s" % (self.conffile,msg)) + if self.localconffile and 'last_revision' in missing_options: + logger.error("local configuration file %s may be missing configuration for combo branch %s" % (self.localconffile, self.combobranch)) + sys.exit(1) + + # filterdiff is required by action_splitpatch, so check its availability + if subprocess.call("which filterdiff > /dev/null 2>&1", shell=True) != 0: + logger.error("ERROR: patchutils package is missing, please install it (e.g. # apt-get install patchutils)") + sys.exit(1) + +def runcmd(cmd,destdir=None,printerr=True): + """ + execute command, raise CalledProcessError if fail + return output if succeed + """ + logger.debug("run cmd '%s' in %s" % (cmd, os.getcwd() if destdir is None else destdir)) + out = os.tmpfile() + try: + subprocess.check_call(cmd, stdout=out, stderr=out, cwd=destdir, shell=True) + except subprocess.CalledProcessError,e: + out.seek(0) + if printerr: + logger.error("%s" % out.read()) + raise e + + out.seek(0) + output = out.read() + logger.debug("output: %s" % output ) + return output + +def action_init(conf, args): + """ + Clone component repositories + Check git is initialised; if not, copy initial data from component repos + """ + for name in conf.repos: + ldir = conf.repos[name]['local_repo_dir'] + if not os.path.exists(ldir): + logger.info("cloning %s to %s" %(conf.repos[name]['src_uri'], ldir)) + subprocess.check_call("git clone %s %s" % (conf.repos[name]['src_uri'], ldir), shell=True) + if not os.path.exists(".git"): + runcmd("git init") + for name in conf.repos: + repo = conf.repos[name] + ldir = repo['local_repo_dir'] + branch = repo.get('branch', "master") + lastrev = repo.get('last_revision', None) + if lastrev and lastrev != "HEAD": + initialrev = lastrev + if branch: + if not check_rev_branch(name, ldir, lastrev, branch): + sys.exit(1) + logger.info("Copying data from %s at specified revision %s..." % (name, lastrev)) + else: + lastrev = None + initialrev = branch + logger.info("Copying data from %s..." % name) + dest_dir = repo['dest_dir'] + if dest_dir and dest_dir != ".": + extract_dir = os.path.join(os.getcwd(), dest_dir) + if not os.path.exists(extract_dir): + os.makedirs(extract_dir) + else: + extract_dir = os.getcwd() + file_filter = repo.get('file_filter', "") + runcmd("git archive %s | tar -x -C %s %s" % (initialrev, extract_dir, file_filter), ldir) + if not lastrev: + lastrev = runcmd("git rev-parse %s" % initialrev, ldir).strip() + conf.update(name, "last_revision", lastrev, initmode=True) + runcmd("git add .") + if conf.localconffile: + localadded = True + try: + runcmd("git rm --cached %s" % conf.localconffile, printerr=False) + except subprocess.CalledProcessError: + localadded = False + if localadded: + localrelpath = os.path.relpath(conf.localconffile) + runcmd("grep -q %s .gitignore || echo %s >> .gitignore" % (localrelpath, localrelpath)) + runcmd("git add .gitignore") + logger.info("Added local configuration file %s to .gitignore", localrelpath) + logger.info("Initial combo layer repository data has been created; please make any changes if desired and then use 'git commit' to make the initial commit.") + else: + logger.info("Repository already initialised, nothing to do.") + + +def check_repo_clean(repodir): + """ + check if the repo is clean + exit if repo is dirty + """ + output=runcmd("git status --porcelain", repodir) + r = re.compile('\?\? patch-.*/') + dirtyout = [item for item in output.splitlines() if not r.match(item)] + if dirtyout: + logger.error("git repo %s is dirty, please fix it first", repodir) + sys.exit(1) + +def check_patch(patchfile): + f = open(patchfile) + ln = f.readline() + of = None + in_patch = False + beyond_msg = False + pre_buf = '' + while ln: + if not beyond_msg: + if ln == '---\n': + if not of: + break + in_patch = False + beyond_msg = True + elif ln.startswith('--- '): + # We have a diff in the commit message + in_patch = True + if not of: + print('WARNING: %s contains a diff in its commit message, indenting to avoid failure during apply' % patchfile) + of = open(patchfile + '.tmp', 'w') + of.write(pre_buf) + pre_buf = '' + elif in_patch and not ln[0] in '+-@ \n\r': + in_patch = False + if of: + if in_patch: + of.write(' ' + ln) + else: + of.write(ln) + else: + pre_buf += ln + ln = f.readline() + f.close() + if of: + of.close() + os.rename(patchfile + '.tmp', patchfile) + +def drop_to_shell(workdir=None): + shell = os.environ.get('SHELL', 'bash') + print('Dropping to shell "%s"\n' \ + 'When you are finished, run the following to continue:\n' \ + ' exit -- continue to apply the patches\n' \ + ' exit 1 -- abort\n' % shell); + ret = subprocess.call([shell], cwd=workdir) + if ret != 0: + print "Aborting" + return False + else: + return True + +def check_rev_branch(component, repodir, rev, branch): + try: + actualbranch = runcmd("git branch --contains %s" % rev, repodir, printerr=False) + except subprocess.CalledProcessError as e: + if e.returncode == 129: + actualbranch = "" + else: + raise + + if not actualbranch: + logger.error("%s: specified revision %s is invalid!" % (component, rev)) + return False + + branches = [] + branchlist = actualbranch.split("\n") + for b in branchlist: + branches.append(b.strip().split(' ')[-1]) + + if branch not in branches: + logger.error("%s: specified revision %s is not on specified branch %s!" % (component, rev, branch)) + return False + return True + +def get_repos(conf, args): + repos = [] + if len(args) > 1: + for arg in args[1:]: + if arg.startswith('-'): + break + else: + repos.append(arg) + for repo in repos: + if not repo in conf.repos: + logger.error("Specified component '%s' not found in configuration" % repo) + sys.exit(0) + + if not repos: + repos = conf.repos + + return repos + +def action_pull(conf, args): + """ + update the component repos only + """ + repos = get_repos(conf, args) + + # make sure all repos are clean + for name in repos: + check_repo_clean(conf.repos[name]['local_repo_dir']) + + for name in repos: + repo = conf.repos[name] + ldir = repo['local_repo_dir'] + branch = repo.get('branch', "master") + runcmd("git checkout %s" % branch, ldir) + logger.info("git pull for component repo %s in %s ..." % (name, ldir)) + output=runcmd("git pull", ldir) + logger.info(output) + +def action_update(conf, args): + """ + update the component repos + generate the patch list + apply the generated patches + """ + repos = get_repos(conf, args) + + # make sure combo repo is clean + check_repo_clean(os.getcwd()) + + import uuid + patch_dir = "patch-%s" % uuid.uuid4() + if not os.path.exists(patch_dir): + os.mkdir(patch_dir) + + # Step 1: update the component repos + if conf.nopull: + logger.info("Skipping pull (-n)") + else: + action_pull(conf, args) + + for name in repos: + repo = conf.repos[name] + ldir = repo['local_repo_dir'] + dest_dir = repo['dest_dir'] + branch = repo.get('branch', "master") + repo_patch_dir = os.path.join(os.getcwd(), patch_dir, name) + + # Step 2: generate the patch list and store to patch dir + logger.info("Generating patches from %s..." % name) + if dest_dir != ".": + prefix = "--src-prefix=a/%s/ --dst-prefix=b/%s/" % (dest_dir, dest_dir) + else: + prefix = "" + if repo['last_revision'] == "": + logger.info("Warning: last_revision of component %s is not set, starting from the first commit" % name) + patch_cmd_range = "--root %s" % branch + rev_cmd_range = branch + else: + if not check_rev_branch(name, ldir, repo['last_revision'], branch): + sys.exit(1) + patch_cmd_range = "%s..%s" % (repo['last_revision'], branch) + rev_cmd_range = patch_cmd_range + + file_filter = repo.get('file_filter',"") + + patch_cmd = "git format-patch -N %s --output-directory %s %s -- %s" % \ + (prefix,repo_patch_dir, patch_cmd_range, file_filter) + output = runcmd(patch_cmd, ldir) + logger.debug("generated patch set:\n%s" % output) + patchlist = output.splitlines() + + rev_cmd = 'git rev-list --no-merges ' + rev_cmd_range + revlist = runcmd(rev_cmd, ldir).splitlines() + + # Step 3: Call repo specific hook to adjust patch + if 'hook' in repo: + # hook parameter is: ./hook patchpath revision reponame + count=len(revlist)-1 + for patch in patchlist: + runcmd("%s %s %s %s" % (repo['hook'], patch, revlist[count], name)) + count=count-1 + + # Step 4: write patch list and revision list to file, for user to edit later + patchlist_file = os.path.join(os.getcwd(), patch_dir, "patchlist-%s" % name) + repo['patchlist'] = patchlist_file + f = open(patchlist_file, 'w') + count=len(revlist)-1 + for patch in patchlist: + f.write("%s %s\n" % (patch, revlist[count])) + check_patch(os.path.join(patch_dir, patch)) + count=count-1 + f.close() + + # Step 5: invoke bash for user to edit patch and patch list + if conf.interactive: + print('You may now edit the patch and patch list in %s\n' \ + 'For example, you can remove unwanted patch entries from patchlist-*, so that they will be not applied later' % patch_dir); + if not drop_to_shell(patch_dir): + sys.exit(0) + + # Step 6: apply the generated and revised patch + apply_patchlist(conf, repos) + runcmd("rm -rf %s" % patch_dir) + + # Step 7: commit the updated config file if it's being tracked + relpath = os.path.relpath(conf.conffile) + try: + output = runcmd("git status --porcelain %s" % relpath, printerr=False) + except: + # Outside the repository + output = None + if output: + logger.info("Committing updated configuration file") + if output.lstrip().startswith("M"): + runcmd('git commit -m "Automatic commit to update last_revision" %s' % relpath) + +def apply_patchlist(conf, repos): + """ + apply the generated patch list to combo repo + """ + for name in repos: + repo = conf.repos[name] + lastrev = repo["last_revision"] + prevrev = lastrev + + # Get non-blank lines from patch list file + patchlist = [] + if os.path.exists(repo['patchlist']) or not conf.interactive: + # Note: we want this to fail here if the file doesn't exist and we're not in + # interactive mode since the file should exist in this case + with open(repo['patchlist']) as f: + for line in f: + line = line.rstrip() + if line: + patchlist.append(line) + + if patchlist: + logger.info("Applying patches from %s..." % name) + linecount = len(patchlist) + i = 1 + for line in patchlist: + patchfile = line.split()[0] + lastrev = line.split()[1] + patchdisp = os.path.relpath(patchfile) + if os.path.getsize(patchfile) == 0: + logger.info("(skipping %d/%d %s - no changes)" % (i, linecount, patchdisp)) + else: + cmd = "git am --keep-cr -s -p1 %s" % patchfile + logger.info("Applying %d/%d: %s" % (i, linecount, patchdisp)) + try: + runcmd(cmd) + except subprocess.CalledProcessError: + logger.info('Running "git am --abort" to cleanup repo') + runcmd("git am --abort") + logger.error('"%s" failed' % cmd) + logger.info("Please manually apply patch %s" % patchdisp) + logger.info("Note: if you exit and continue applying without manually applying the patch, it will be skipped") + if not drop_to_shell(): + if prevrev != repo['last_revision']: + conf.update(name, "last_revision", prevrev) + sys.exit(0) + prevrev = lastrev + i += 1 + else: + logger.info("No patches to apply from %s" % name) + ldir = conf.repos[name]['local_repo_dir'] + branch = conf.repos[name].get('branch', "master") + lastrev = runcmd("git rev-parse %s" % branch, ldir).strip() + + if lastrev != repo['last_revision']: + conf.update(name, "last_revision", lastrev) + +def action_splitpatch(conf, args): + """ + generate the commit patch and + split the patch per repo + """ + logger.debug("action_splitpatch") + if len(args) > 1: + commit = args[1] + else: + commit = "HEAD" + patchdir = "splitpatch-%s" % commit + if not os.path.exists(patchdir): + os.mkdir(patchdir) + + # filerange_root is for the repo whose dest_dir is root "." + # and it should be specified by excluding all other repo dest dir + # like "-x repo1 -x repo2 -x repo3 ..." + filerange_root = "" + for name in conf.repos: + dest_dir = conf.repos[name]['dest_dir'] + if dest_dir != ".": + filerange_root = '%s -x "%s/*"' % (filerange_root, dest_dir) + + for name in conf.repos: + dest_dir = conf.repos[name]['dest_dir'] + patch_filename = "%s/%s.patch" % (patchdir, name) + if dest_dir == ".": + cmd = "git format-patch -n1 --stdout %s^..%s | filterdiff -p1 %s > %s" % (commit, commit, filerange_root, patch_filename) + else: + cmd = "git format-patch --no-prefix -n1 --stdout %s^..%s -- %s > %s" % (commit, commit, dest_dir, patch_filename) + runcmd(cmd) + # Detect empty patches (including those produced by filterdiff above + # that contain only preamble text) + if os.path.getsize(patch_filename) == 0 or runcmd("filterdiff %s" % patch_filename) == "": + os.remove(patch_filename) + logger.info("(skipping %s - no changes)", name) + else: + logger.info(patch_filename) + +def action_error(conf, args): + logger.info("invalid action %s" % args[0]) + +actions = { + "init": action_init, + "update": action_update, + "pull": action_pull, + "splitpatch": action_splitpatch, +} + +def main(): + parser = optparse.OptionParser( + version = "Combo Layer Repo Tool version %s" % __version__, + usage = """%prog [options] action + +Create and update a combination layer repository from multiple component repositories. + +Action: + init initialise the combo layer repo + update [components] get patches from component repos and apply them to the combo repo + pull [components] just pull component repos only + splitpatch [commit] generate commit patch and split per component, default commit is HEAD""") + + parser.add_option("-c", "--conf", help = "specify the config file (conf/combo-layer.conf is the default).", + action = "store", dest = "conffile", default = "conf/combo-layer.conf") + + parser.add_option("-i", "--interactive", help = "interactive mode, user can edit the patch list and patches", + action = "store_true", dest = "interactive", default = False) + + parser.add_option("-D", "--debug", help = "output debug information", + action = "store_true", dest = "debug", default = False) + + parser.add_option("-n", "--no-pull", help = "skip pulling component repos during update", + action = "store_true", dest = "nopull", default = False) + + options, args = parser.parse_args(sys.argv) + + # Dispatch to action handler + if len(args) == 1: + logger.error("No action specified, exiting") + parser.print_help() + elif args[1] not in actions: + logger.error("Unsupported action %s, exiting\n" % (args[1])) + parser.print_help() + elif not os.path.exists(options.conffile): + logger.error("No valid config file, exiting\n") + parser.print_help() + else: + if options.debug: + logger.setLevel(logging.DEBUG) + confdata = Configuration(options) + initmode = (args[1] == 'init') + confdata.sanity_check(initmode) + actions.get(args[1], action_error)(confdata, args[1:]) + +if __name__ == "__main__": + try: + ret = main() + except Exception: + ret = 1 + import traceback + traceback.print_exc(5) + sys.exit(ret) diff --git a/scripts/combo-layer-hook-default.sh b/scripts/combo-layer-hook-default.sh new file mode 100755 index 0000000000..8b148aca07 --- /dev/null +++ b/scripts/combo-layer-hook-default.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# Hook to add source component/revision info to commit message +# Parameter: +# $1 patch-file +# $2 revision +# $3 reponame + +patchfile=$1 +rev=$2 +reponame=$3 + +sed -i -e "s#^Subject: \[PATCH\] \(.*\)#Subject: \[PATCH\] $reponame: \1#" $patchfile +sed -i -e "0,/^Signed-off-by:/s#\(^Signed-off-by:.*\)#\($reponame rev: $rev\)\n\n\1#" $patchfile diff --git a/scripts/combo-layer.conf.example b/scripts/combo-layer.conf.example new file mode 100644 index 0000000000..010a692350 --- /dev/null +++ b/scripts/combo-layer.conf.example @@ -0,0 +1,56 @@ +# combo-layer example configuration file + +# component name +[bitbake] +# mandatory options +# git upstream uri +src_uri = git://git.openembedded.org/bitbake + +# the directory to clone the component repo +local_repo_dir = /home/kyu3/src/test/bitbake + +# the relative dir within the combo repo to put the component files +# use "." if the files should be in the root dir +dest_dir = bitbake + +# the last update revision. +# "init" will set this to the latest revision automatically, however if it +# is empty when "update" is run, the tool will start from the first commit. +# Note that this value will get updated by "update" if the component repo's +# latest revision changed and the operation completes successfully. +last_revision = + +# optional options: + +# branch: specify the branch in the component repo to pull from +# (master if not specified) + +# file_filter: only include the specified file(s) +# file_filter = [path] [path] ... +# example: +# file_filter = src/ : only include the subdir src +# file_filter = src/*.c : only include the src *.c file +# file_filter = src/main.c src/Makefile.am : only include these two files + +# hook: if provided, the tool will call the hook to process the generated +# patch from upstream, and then apply the modified patch to the combo +# repo. +# the hook script is called as follows: ./hook patchpath revision reponame +# example: +# hook = combo-layer-hook-default.sh + +[oe-core] +src_uri = git://git.openembedded.org/openembedded-core +local_repo_dir = /home/kyu3/src/test/oecore +dest_dir = . +last_revision = + +# It is also possible to embed python code in the config values. Similar +# to bitbake it considers every value starting with @ to be a python +# script. +# e.g. local_repo_dir could easily be configured using an environment +# variable: +# +# [bitbake] +# local_repo_dir = @os.getenv("LOCAL_REPO_DIR") + "/bitbake" +# diff --git a/scripts/contrib/bb-perf/bb-matrix-plot.sh b/scripts/contrib/bb-perf/bb-matrix-plot.sh new file mode 100755 index 0000000000..136a25570d --- /dev/null +++ b/scripts/contrib/bb-perf/bb-matrix-plot.sh @@ -0,0 +1,137 @@ +#!/bin/bash +# +# Copyright (c) 2011, Intel Corporation. +# All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# DESCRIPTION +# This script operates on the .dat file generated by bb-matrix.sh. It tolerates +# the header by skipping the first line, but error messages and bad data records +# need to be removed first. It will generate three views of the plot, and leave +# an interactive view open for further analysis. +# +# AUTHORS +# Darren Hart +# + +# Setup the defaults +DATFILE="bb-matrix.dat" +XLABEL="BB_NUMBER_THREADS" +YLABEL="PARALLEL_MAKE" +FIELD=3 +DEF_TITLE="Elapsed Time (seconds)" +PM3D_FRAGMENT="unset surface; set pm3d at s hidden3d 100" +SIZE="640,480" + +function usage { +CMD=$(basename $0) +cat < +# + +# The following ranges are appropriate for a 4 core system with 8 logical units +# Use leading 0s to ensure all digits are the same string length, this results +# in nice log file names and columnar dat files. +BB_RANGE="04 05 06 07 08 09 10 11 12 13 14 15 16" +PM_RANGE="04 05 06 07 08 09 10 11 12 13 14 15 16" + +DATADIR="bb-matrix-$$" +BB_CMD="bitbake core-image-minimal" +RUNTIME_LOG="$DATADIR/bb-matrix.dat" + +# See TIME(1) for a description of the time format parameters +# The following all report 0: W K r s t w +TIME_STR="%e %S %U %P %c %w %R %F %M %x" + +# Prepare the DATADIR +mkdir $DATADIR +if [ $? -ne 0 ]; then + echo "Failed to create $DATADIR." + exit 1 +fi + +# Add a simple header +echo "BB PM $TIME_STR" > $RUNTIME_LOG +for BB in $BB_RANGE; do + for PM in $PM_RANGE; do + RUNDIR="$DATADIR/$BB-$PM-build" + mkdir $RUNDIR + BB_LOG=$RUNDIR/$BB-$PM-bitbake.log + date + echo "BB=$BB PM=$PM Logging to $BB_LOG" + + echo -n " Preparing the work directory... " + rm -rf pseudodone tmp sstate-cache tmp-eglibc &> /dev/null + echo "done" + + # Export the variables under test and run the bitbake command + # Strip any leading zeroes before passing to bitbake + export BB_NUMBER_THREADS=$(echo $BB | sed 's/^0*//') + export PARALLEL_MAKE="-j $(echo $PM | sed 's/^0*//')" + /usr/bin/time -f "$BB $PM $TIME_STR" -a -o $RUNTIME_LOG $BB_CMD &> $BB_LOG + + echo " $(tail -n1 $RUNTIME_LOG)" + cp -a tmp/buildstats $RUNDIR/$BB-$PM-buildstats + done +done diff --git a/scripts/contrib/bbvars.py b/scripts/contrib/bbvars.py new file mode 100755 index 0000000000..0896d64445 --- /dev/null +++ b/scripts/contrib/bbvars.py @@ -0,0 +1,186 @@ +#!/usr/bin/env python + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# Copyright (C) Darren Hart , 2010 + + +import sys +import getopt +import os +import os.path +import re + +def usage(): + print 'Usage: %s -d FILENAME [-d FILENAME]* -m METADIR [-m MATADIR]*' % os.path.basename(sys.argv[0]) + print ' -d FILENAME documentation file to search' + print ' -h, --help display this help and exit' + print ' -m METADIR meta directory to search for recipes' + print ' -t FILENAME documentation config file (for doc tags)' + print ' -T Only display variables with doc tags (requires -t)' + +def recipe_bbvars(recipe): + ''' Return a unique set of every bbvar encountered in the recipe ''' + prog = re.compile("[A-Z_]+") + vset = set() + try: + r = open(recipe) + except IOError as (errno, strerror): + print 'WARNING: Failed to open recipe ', recipe + print strerror + + for line in r: + # Strip any comments from the line + line = line.rsplit('#')[0] + vset = vset.union(set(prog.findall(line))) + r.close() + + bbvars = {} + for v in vset: + bbvars[v] = 1 + + return bbvars + +def collect_bbvars(metadir): + ''' Walk the metadir and collect the bbvars from each recipe found ''' + bbvars = {} + for root,dirs,files in os.walk(metadir): + for name in files: + if name.find(".bb") >= 0: + for key in recipe_bbvars(os.path.join(root,name)).iterkeys(): + if bbvars.has_key(key): + bbvars[key] = bbvars[key] + 1 + else: + bbvars[key] = 1 + return bbvars + +def bbvar_is_documented(var, docfiles): + prog = re.compile(".*($|[^A-Z_])%s([^A-Z_]|$)" % (var)) + for doc in docfiles: + try: + f = open(doc) + except IOError as (errno, strerror): + print 'WARNING: Failed to open doc ', doc + print strerror + for line in f: + if prog.match(line): + return True + f.close() + return False + +def bbvar_doctag(var, docconf): + prog = re.compile('^%s\[doc\] *= *"(.*)"' % (var)) + if docconf == "": + return "?" + + try: + f = open(docconf) + except IOError as (errno, strerror): + return strerror + + for line in f: + m = prog.search(line) + if m: + return m.group(1) + + f.close() + return "" + +def main(): + docfiles = [] + metadirs = [] + bbvars = {} + undocumented = [] + docconf = "" + onlydoctags = False + + # Collect and validate input + try: + opts, args = getopt.getopt(sys.argv[1:], "d:hm:t:T", ["help"]) + except getopt.GetoptError, err: + print '%s' % str(err) + usage() + sys.exit(2) + + for o, a in opts: + if o in ('-h', '--help'): + usage() + sys.exit(0) + elif o == '-d': + if os.path.isfile(a): + docfiles.append(a) + else: + print 'ERROR: documentation file %s is not a regular file' % (a) + sys.exit(3) + elif o == '-m': + if os.path.isdir(a): + metadirs.append(a) + else: + print 'ERROR: meta directory %s is not a directory' % (a) + sys.exit(4) + elif o == "-t": + if os.path.isfile(a): + docconf = a + elif o == "-T": + onlydoctags = True + else: + assert False, "unhandled option" + + if len(docfiles) == 0: + print 'ERROR: no docfile specified' + usage() + sys.exit(5) + + if len(metadirs) == 0: + print 'ERROR: no metadir specified' + usage() + sys.exit(6) + + if onlydoctags and docconf == "": + print 'ERROR: no docconf specified' + usage() + sys.exit(7) + + # Collect all the variable names from the recipes in the metadirs + for m in metadirs: + for key,cnt in collect_bbvars(m).iteritems(): + if bbvars.has_key(key): + bbvars[key] = bbvars[key] + cnt + else: + bbvars[key] = cnt + + # Check each var for documentation + varlen = 0 + for v in bbvars.iterkeys(): + if len(v) > varlen: + varlen = len(v) + if not bbvar_is_documented(v, docfiles): + undocumented.append(v) + undocumented.sort() + varlen = varlen + 1 + + # Report all undocumented variables + print 'Found %d undocumented bb variables (out of %d):' % (len(undocumented), len(bbvars)) + header = '%s%s%s' % (str("VARIABLE").ljust(varlen), str("COUNT").ljust(6), str("DOCTAG").ljust(7)) + print header + print str("").ljust(len(header), '=') + for v in undocumented: + doctag = bbvar_doctag(v, docconf) + if not onlydoctags or not doctag == "": + print '%s%s%s' % (v.ljust(varlen), str(bbvars[v]).ljust(6), doctag) + + +if __name__ == "__main__": + main() diff --git a/scripts/contrib/build-perf-test.sh b/scripts/contrib/build-perf-test.sh new file mode 100755 index 0000000000..be3b648046 --- /dev/null +++ b/scripts/contrib/build-perf-test.sh @@ -0,0 +1,369 @@ +#!/bin/bash +# +# This script runs a series of tests (with and without sstate) and reports build time (and tmp/ size) +# +# Build performance test script +# +# Copyright 2013 Intel Corporation +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# +# AUTHORS: +# Stefan Stanacar + + +ME=$(basename $0) + +# +# usage and setup +# + +usage () { +cat << EOT +Usage: $ME [-h] + $ME [-c ] [-v] [-m ] [-j ] [-t ] [-i ] [-d ] +Options: + -h + Display this help and exit. + -c + git checkout before anything else + -v + Show bitbake output, don't redirect it to a log. + -m + Value for MACHINE. Default is qemux86. + -j + Value for PARALLEL_MAKE. Default is 8. + -t + Value for BB_NUMBER_THREADS. Default is 8. + -i + Instead of timing against core-image-sato, use + -d + Use as DL_DIR + -p + Cherry pick githash onto the commit + +Note: current working directory must be inside a poky git clone. + +EOT +} + + +if clonedir=$(git rev-parse --show-toplevel); then + cd $clonedir +else + echo "The current working dir doesn't seem to be a poky git clone. Please cd there before running $ME" + exit 1 +fi + +IMAGE="core-image-sato" +verbose=0 +dldir= +commit= +pmake= +cherrypicks= +while getopts "hvc:m:j:t:i:d:p:" opt; do + case $opt in + h) usage + exit 0 + ;; + v) verbose=1 + ;; + c) commit=$OPTARG + ;; + m) export MACHINE=$OPTARG + ;; + j) pmake=$OPTARG + ;; + t) export BB_NUMBER_THREADS=$OPTARG + ;; + i) IMAGE=$OPTARG + ;; + d) dldir=$OPTARG + ;; + p) cherrypicks="$cherrypicks $OPTARG" + ;; + *) usage + exit 1 + ;; + esac +done + + +#drop cached credentials and test for sudo access without a password +sudo -k -n ls > /dev/null 2>&1 +reqpass=$? +if [ $reqpass -ne 0 ]; then + echo "The script requires sudo access to drop caches between builds (echo 3 > /proc/sys/vm/drop_caches)" + read -s -p "Please enter your sudo password: " pass + echo +fi + +if [ -n "$commit" ]; then + echo "git checkout -f $commit" + git pull > /dev/null 2>&1 + git checkout -f $commit || exit 1 + git pull > /dev/null 2>&1 +fi + +if [ -n "$cherrypicks" ]; then + for c in $cherrypicks; do + git cherry-pick $c + done +fi + +rev=$(git rev-parse --short HEAD) || exit 1 +OUTDIR="$clonedir/build-perf-test/results-$rev-`date "+%Y%m%d%H%M%S"`" +BUILDDIR="$OUTDIR/build" +resultsfile="$OUTDIR/results.log" +bboutput="$OUTDIR/bitbake.log" +myoutput="$OUTDIR/output.log" +globalres="$clonedir/build-perf-test/globalres.log" + +mkdir -p $OUTDIR || exit 1 + +log () { + local msg="$1" + echo "`date`: $msg" | tee -a $myoutput +} + + +# +# Config stuff +# + +branch=`git branch 2>&1 | grep "^* " | tr -d "* "` +gitcommit=$(git rev-parse HEAD) || exit 1 +log "Running on $branch:$gitcommit" + +source ./oe-init-build-env $OUTDIR/build >/dev/null || exit 1 +cd $OUTDIR/build + +[ -n "$MACHINE" ] || export MACHINE="qemux86" +[ -n "$BB_NUMBER_THREADS" ] || export BB_NUMBER_THREADS="8" + +if [ -n "$pmake" ]; then + export PARALLEL_MAKE="-j $pmake" +else + export PARALLEL_MAKE="-j 8" +fi + +if [ -n "$dldir" ]; then + echo "DL_DIR = \"$dldir\"" >> conf/local.conf +else + echo "DL_DIR = \"$clonedir/build-perf-test/downloads\"" >> conf/local.conf +fi + +# Sometimes I've noticed big differences in timings for the same commit, on the same machine +# Disabling the network sanity check helps a bit (because of my crappy network connection and/or proxy) +echo "CONNECTIVITY_CHECK_URIS =\"\"" >> conf/local.conf + + +# +# Functions +# + +declare -a TIMES +time_count=0 +declare -a SIZES +size_count=0 + +bbtime () { + local arg="$@" + log " Timing: bitbake ${arg}" + + if [ $verbose -eq 0 ]; then + /usr/bin/time -v -o $resultsfile bitbake ${arg} >> $bboutput + else + /usr/bin/time -v -o $resultsfile bitbake ${arg} + fi + ret=$? + if [ $ret -eq 0 ]; then + t=`grep wall $resultsfile | sed 's/.*m:ss): //'` + log " TIME: $t" + TIMES[(( time_count++ ))]="$t" + else + log "ERROR: exit status was non-zero, will report time as 0." + TIMES[(( time_count++ ))]="0" + fi + + #time by default overwrites the output file and we want to keep the results + #it has an append option but I don't want to clobber the results in the same file + i=`ls $OUTDIR/results.log* |wc -l` + mv $resultsfile "${resultsfile}.${i}" + log "More stats can be found in ${resultsfile}.${i}" +} + +#we don't time bitbake here +bbnotime () { + local arg="$@" + log " Running: bitbake ${arg}" + if [ $verbose -eq 0 ]; then + bitbake ${arg} >> $bboutput + else + bitbake ${arg} + fi + ret=$? + if [ $ret -eq 0 ]; then + log " Finished bitbake ${arg}" + else + log "ERROR: exit status was non-zero. Exit.." + exit $ret + fi + +} + +do_rmtmp() { + log " Removing tmp" + rm -rf bitbake.lock pseudodone conf/sanity_info cache tmp +} +do_rmsstate () { + log " Removing sstate-cache" + rm -rf sstate-cache +} +do_sync () { + log " Syncing and dropping caches" + sync; sync + if [ $reqpass -eq 0 ]; then + sudo sh -c "echo 3 > /proc/sys/vm/drop_caches" + else + echo "$pass" | sudo -S sh -c "echo 3 > /proc/sys/vm/drop_caches" + echo + fi + sleep 3 +} + +write_results() { + echo -n "`uname -n`,$branch:$gitcommit,`git describe`," >> $globalres + for i in "${TIMES[@]}"; do + echo -n "$i," >> $globalres + done + for i in "${SIZES[@]}"; do + echo -n "$i," >> $globalres + done + echo >> $globalres + sed -i '$ s/,$//' $globalres +} + +#### + +# +# Test 1 +# Measure: Wall clock of "bitbake core-image-sato" and size of tmp/dir (w/o rm_work and w/ rm_work) +# Pre: Downloaded sources, no sstate +# Steps: +# Part1: +# - fetchall +# - clean build dir +# - time bitbake core-image-sato +# - collect data +# Part2: +# - bitbake virtual/kernel -c cleansstate +# - time bitbake virtual/kernel +# Part3: +# - add INHERIT to local.conf +# - clean build dir +# - build +# - report size, remove INHERIT + +test1_p1 () { + log "Running Test 1, part 1/3: Measure wall clock of bitbake $IMAGE and size of tmp/ dir" + bbnotime $IMAGE -c fetchall + do_rmtmp + do_rmsstate + do_sync + bbtime $IMAGE + s=`du -s tmp | sed 's/tmp//' | sed 's/[ \t]*$//'` + SIZES[(( size_count++ ))]="$s" + log "SIZE of tmp dir is: $s" + log "Buildstats are saved in $OUTDIR/buildstats-test1" + mv tmp/buildstats $OUTDIR/buildstats-test1 +} + + +test1_p2 () { + log "Running Test 1, part 2/3: bitbake virtual/kernel -c cleansstate and time bitbake virtual/kernel" + bbnotime virtual/kernel -c cleansstate + do_sync + bbtime virtual/kernel +} + +test1_p3 () { + log "Running Test 1, part 3/3: Build $IMAGE w/o sstate and report size of tmp/dir with rm_work enabled" + echo "INHERIT += \"rm_work\"" >> conf/local.conf + do_rmtmp + do_rmsstate + do_sync + bbtime $IMAGE + sed -i 's/INHERIT += \"rm_work\"//' conf/local.conf + s=`du -s tmp | sed 's/tmp//' | sed 's/[ \t]*$//'` + SIZES[(( size_count++ ))]="$s" + log "SIZE of tmp dir is: $s" + log "Buildstats are saved in $OUTDIR/buildstats-test13" + mv tmp/buildstats $OUTDIR/buildstats-test13 +} + + +# +# Test 2 +# Measure: Wall clock of "bitbake core-image-sato" and size of tmp/dir +# Pre: populated sstate cache + +test2 () { + # Assuming test 1 has run + log "Running Test 2: Measure wall clock of bitbake $IMAGE -c rootfs with sstate" + do_rmtmp + do_sync + bbtime $IMAGE -c rootfs +} + + +# Test 3 +# parsing time metrics +# +# Start with +# i) "rm -rf tmp/cache; time bitbake -p" +# ii) "rm -rf tmp/cache/default-eglibc/; time bitbake -p" +# iii) "time bitbake -p" + + +test3 () { + log "Running Test 3: Parsing time metrics (bitbake -p)" + log " Removing tmp/cache && cache" + rm -rf tmp/cache cache + bbtime -p + log " Removing tmp/cache/default-eglibc/" + rm -rf tmp/cache/default-eglibc/ + bbtime -p + bbtime -p +} + + + +# RUN! + +test1_p1 +test1_p2 +test1_p3 +test2 +test3 + +# if we got til here write to global results +write_results + +log "All done, cleaning up..." + +do_rmtmp +do_rmsstate diff --git a/scripts/contrib/ddimage b/scripts/contrib/ddimage new file mode 100755 index 0000000000..93ebeafc31 --- /dev/null +++ b/scripts/contrib/ddimage @@ -0,0 +1,89 @@ +#!/bin/sh + +#BLACKLIST_DEVICES="/dev/sda /dev/sdb /dev/sdc /dev/sdd /dev/sde" +BLACKLIST_DEVICES="/dev/sda" + +# 1MB blocksize +BLOCKSIZE=1048576 + +usage() { + echo "Usage: $(basename $0) IMAGE DEVICE" +} + +image_details() { + IMG=$1 + echo "Image details" + echo "=============" + echo " image: $(stat --printf '%N\n' $IMG)" + echo " size: $(stat -L --printf '%s bytes\n' $IMG)" + echo " modified: $(stat -L --printf '%y\n' $IMG)" + echo " type: $(file -L -b $IMG)" + echo "" +} + +device_details() { + DEV=$1 + BLOCK_SIZE=512 + + echo "Device details" + echo "==============" + echo " device: $DEVICE" + if [ -f "/sys/class/block/$DEV/device/vendor" ]; then + echo " vendor: $(cat /sys/class/block/$DEV/device/vendor)" + else + echo " vendor: UNKOWN" + fi + if [ -f "/sys/class/block/$DEV/device/model" ]; then + echo " model: $(cat /sys/class/block/$DEV/device/model)" + else + echo " model: UNKNOWN" + fi + if [ -f "/sys/class/block/$DEV/size" ]; then + echo " size: $(($(cat /sys/class/block/$DEV/size) * $BLOCK_SIZE)) bytes" + else + echo " size: UNKNOWN" + fi + echo "" +} + +if [ $# -ne 2 ]; then + usage + exit 1 +fi + +IMAGE=$1 +DEVICE=$2 + +if [ ! -e "$IMAGE" ]; then + echo "ERROR: Image $IMAGE does not exist" + usage + exit 1 +fi + + +for i in ${BLACKLIST_DEVICES}; do + if [ "$i" = "$DEVICE" ]; then + echo "ERROR: Device $DEVICE is blacklisted" + exit 1 + fi +done + +if [ ! -w "$DEVICE" ]; then + echo "ERROR: Device $DEVICE does not exist or is not writable" + usage + exit 1 +fi + +image_details $IMAGE +device_details $(basename $DEVICE) + +printf "Write $IMAGE to $DEVICE [y/N]? " +read RESPONSE +if [ "$RESPONSE" != "y" ]; then + echo "Write aborted" + exit 0 +fi + +echo "Writing image..." +dd if="$IMAGE" of="$DEVICE" bs="$BLOCKSIZE" +sync diff --git a/scripts/contrib/documentation-audit.sh b/scripts/contrib/documentation-audit.sh new file mode 100755 index 0000000000..2144aac936 --- /dev/null +++ b/scripts/contrib/documentation-audit.sh @@ -0,0 +1,94 @@ +#!/bin/bash +# +# Perform an audit of which packages provide documentation and which +# are missing -doc packages. +# +# Setup requirements: be sure to be building for MACHINE=qemux86. Run +# this script after source'ing the build environment script, so you're +# running it from build/ directory. +# +# Maintainer: Scott Garman + +REPORT_DOC_SIMPLE="documentation_exists.txt" +REPORT_DOC_DETAIL="documentation_exists_detail.txt" +REPORT_MISSING_SIMPLE="documentation_missing.txt" +REPORT_MISSING_DETAIL="documentation_missing_detail.txt" +REPORT_BUILD_ERRORS="build_errors.txt" + +rm -rf $REPORT_DOC_SIMPLE $REPORT_DOC_DETAIL $REPORT_MISSING_SIMPLE $REPORT_MISSING_DETAIL + +BITBAKE=`which bitbake` +if [ -z "$BITBAKE" ]; then + echo "Error: bitbake command not found." + echo "Did you forget to source the build environment script?" + exit 1 +fi + +echo "REMINDER: you need to build for MACHINE=qemux86 or you won't get useful results" +echo "REMINDER: you need to set LICENSE_FLAGS_WHITELIST appropriately in local.conf or " +echo " you'll get false positives. For example, LICENSE_FLAGS_WHITELIST = \"Commercial\"" + +for pkg in `bitbake -s | awk '{ print \$1 }'`; do + if [[ "$pkg" == "Loading" || "$pkg" == "Loaded" || + "$pkg" == "Recipe" || + "$pkg" == "Parsing" || "$pkg" == "Package" || + "$pkg" == "NOTE:" || "$pkg" == "WARNING:" || + "$pkg" == "done." || "$pkg" == "===========" ]] + then + # Skip initial bitbake output + continue + fi + if [[ "$pkg" =~ -native$ || "$pkg" =~ -nativesdk$ || + "$pkg" =~ -cross-canadian ]]; then + # Skip native/nativesdk/cross-canadian recipes + continue + fi + if [[ "$pkg" =~ ^meta- || "$pkg" =~ ^packagegroup- || "$pkg" =~ -image ]]; then + # Skip meta, task and image recipes + continue + fi + if [[ "$pkg" =~ ^glibc- || "$pkg" =~ ^libiconv$ || + "$pkg" =~ -toolchain$ || "$pkg" =~ ^package-index$ || + "$pkg" =~ ^linux- || "$pkg" =~ ^adt-installer$ || + "$pkg" =~ ^eds-tools$ || "$pkg" =~ ^external-python-tarball$ || + "$pkg" =~ ^qt4-embedded$ || "$pkg" =~ ^qt-mobility ]]; then + # Skip glibc, libiconv, -toolchain, and other recipes known + # to cause build conflicts or trigger false positives. + continue + fi + + echo "Building package $pkg..." + bitbake $pkg > /dev/null + if [ $? -ne 0 ]; then + echo "There was an error building package $pkg" >> "$REPORT_MISSING_DETAIL" + echo "$pkg" >> $REPORT_BUILD_ERRORS + + # Do not skip the remaining tests, as sometimes the + # exit status is 1 due to QA errors, and we can still + # perform the -doc checks. + fi + + echo "$pkg built successfully, checking for a documentation package..." + WORKDIR=`bitbake -e $pkg | grep ^WORKDIR | awk -F '=' '{ print \$2 }' | awk -F '"' '{ print \$2 }'` + FIND_DOC_PKG=`find $WORKDIR/packages-split/*-doc -maxdepth 0 -type d` + if [ -z "$FIND_DOC_PKG" ]; then + # No -doc package was generated: + echo "No -doc package: $pkg" >> "$REPORT_MISSING_DETAIL" + echo "$pkg" >> $REPORT_MISSING_SIMPLE + continue + fi + + FIND_DOC_FILES=`find $FIND_DOC_PKG -type f` + if [ -z "$FIND_DOC_FILES" ]; then + # No files shipped with the -doc package: + echo "No files shipped with the -doc package: $pkg" >> "$REPORT_MISSING_DETAIL" + echo "$pkg" >> $REPORT_MISSING_SIMPLE + continue + fi + + echo "Documentation shipped with $pkg:" >> "$REPORT_DOC_DETAIL" + echo "$FIND_DOC_FILES" >> "$REPORT_DOC_DETAIL" + echo "" >> "$REPORT_DOC_DETAIL" + + echo "$pkg" >> "$REPORT_DOC_SIMPLE" +done diff --git a/scripts/contrib/graph-tool b/scripts/contrib/graph-tool new file mode 100755 index 0000000000..6dc7d337f8 --- /dev/null +++ b/scripts/contrib/graph-tool @@ -0,0 +1,92 @@ +#!/usr/bin/env python + +# Simple graph query utility +# useful for getting answers from .dot files produced by bitbake -g +# +# Written by: Paul Eggleton +# +# Copyright 2013 Intel Corporation +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# + +import sys + +def get_path_networkx(dotfile, fromnode, tonode): + try: + import networkx + except ImportError: + print('ERROR: Please install the networkx python module') + sys.exit(1) + + graph = networkx.DiGraph(networkx.read_dot(dotfile)) + + def node_missing(node): + import difflib + close_matches = difflib.get_close_matches(node, graph.nodes(), cutoff=0.7) + if close_matches: + print('ERROR: no node "%s" in graph. Close matches:\n %s' % (node, '\n '.join(close_matches))) + sys.exit(1) + + if not fromnode in graph: + node_missing(fromnode) + if not tonode in graph: + node_missing(tonode) + return networkx.all_simple_paths(graph, source=fromnode, target=tonode) + + +def find_paths(args, usage): + if len(args) < 3: + usage() + sys.exit(1) + + fromnode = args[1] + tonode = args[2] + paths = list(get_path_networkx(args[0], fromnode, tonode)) + if paths: + for path in paths: + print ' -> '.join(path) + else: + print("ERROR: no path from %s to %s in graph" % (fromnode, tonode)) + sys.exit(1) + +def main(): + import optparse + parser = optparse.OptionParser( + usage = '''%prog [options] + +Available commands: + find-paths + Find all of the paths between two nodes in a dot graph''') + + #parser.add_option("-d", "--debug", + # help = "Report all SRCREV values, not just ones where AUTOREV has been used", + # action="store_true", dest="debug", default=False) + + options, args = parser.parse_args(sys.argv) + args = args[1:] + + if len(args) < 1: + parser.print_help() + sys.exit(1) + + if args[0] == "find-paths": + find_paths(args[1:], parser.print_help) + else: + parser.print_help() + sys.exit(1) + + +if __name__ == "__main__": + main() diff --git a/scripts/contrib/list-packageconfig-flags.py b/scripts/contrib/list-packageconfig-flags.py new file mode 100755 index 0000000000..371033a3d8 --- /dev/null +++ b/scripts/contrib/list-packageconfig-flags.py @@ -0,0 +1,209 @@ +#!/usr/bin/env python + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation. +# +# Copyright (C) 2013 Wind River Systems, Inc. +# +# - list available pkgs which have PACKAGECONFIG flags +# - list available PACKAGECONFIG flags and all affected pkgs +# - list all pkgs and PACKAGECONFIG information + +import sys +import getopt +import os + +def search_bitbakepath(): + bitbakepath = "" + + # Search path to bitbake lib dir in order to load bb modules + if os.path.exists(os.path.join(os.path.dirname(sys.argv[0]), '../../bitbake/lib/bb')): + bitbakepath = os.path.join(os.path.dirname(sys.argv[0]), '../../bitbake/lib') + bitbakepath = os.path.abspath(bitbakepath) + else: + # Look for bitbake/bin dir in PATH + for pth in os.environ['PATH'].split(':'): + if os.path.exists(os.path.join(pth, '../lib/bb')): + bitbakepath = os.path.abspath(os.path.join(pth, '../lib')) + break + if not bitbakepath: + sys.stderr.write("Unable to find bitbake by searching parent directory of this script or PATH\n") + sys.exit(1) + return bitbakepath + +# For importing the following modules +sys.path.insert(0, search_bitbakepath()) +import bb.cache +import bb.cooker +import bb.providers +import bb.tinfoil + +usage_body = ''' list available pkgs which have PACKAGECONFIG flags + +OPTION: + -h, --help display this help and exit + -f, --flag list available PACKAGECONFIG flags and all affected pkgs + -a, --all list all pkgs and PACKAGECONFIG information + -p, --prefer list pkgs with preferred version + +EXAMPLE: +list-packageconfig-flags.py +list-packageconfig-flags.py -f +list-packageconfig-flags.py -a +list-packageconfig-flags.py -p +list-packageconfig-flags.py -f -p +list-packageconfig-flags.py -a -p +''' + +def usage(): + print 'Usage: %s [-f|-a] [-p]' % os.path.basename(sys.argv[0]) + print usage_body + +def get_fnlist(bbhandler, pkg_pn, preferred): + ''' Get all recipe file names ''' + if preferred: + (latest_versions, preferred_versions) = bb.providers.findProviders(bbhandler.config_data, bbhandler.cooker.recipecache, pkg_pn) + + fn_list = [] + for pn in sorted(pkg_pn): + if preferred: + fn_list.append(preferred_versions[pn][1]) + else: + fn_list.extend(pkg_pn[pn]) + + return fn_list + +def get_recipesdata(bbhandler, preferred): + ''' Get data of all available recipes which have PACKAGECONFIG flags ''' + pkg_pn = bbhandler.cooker.recipecache.pkg_pn + + data_dict = {} + for fn in get_fnlist(bbhandler, pkg_pn, preferred): + data = bb.cache.Cache.loadDataFull(fn, bbhandler.cooker.collection.get_file_appends(fn), bbhandler.config_data) + if data.getVarFlags("PACKAGECONFIG"): + data_dict[fn] = data + + return data_dict + +def collect_pkgs(data_dict): + ''' Collect available pkgs in which have PACKAGECONFIG flags ''' + # pkg_dict = {'pkg1': ['flag1', 'flag2',...]} + pkg_dict = {} + for fn in data_dict: + pkgconfigflags = data_dict[fn].getVarFlags("PACKAGECONFIG") + pkgname = data_dict[fn].getVar("P", True) + pkg_dict[pkgname] = sorted(pkgconfigflags.keys()) + + return pkg_dict + +def collect_flags(pkg_dict): + ''' Collect available PACKAGECONFIG flags and all affected pkgs ''' + # flag_dict = {'flag': ['pkg1', 'pkg2',...]} + flag_dict = {} + for pkgname, flaglist in pkg_dict.iteritems(): + for flag in flaglist: + if flag == "defaultval": + continue + + if flag in flag_dict: + flag_dict[flag].append(pkgname) + else: + flag_dict[flag] = [pkgname] + + return flag_dict + +def display_pkgs(pkg_dict): + ''' Display available pkgs which have PACKAGECONFIG flags ''' + pkgname_len = len("PACKAGE NAME") + 1 + for pkgname in pkg_dict: + if pkgname_len < len(pkgname): + pkgname_len = len(pkgname) + pkgname_len += 1 + + header = '%-*s%s' % (pkgname_len, str("PACKAGE NAME"), str("PACKAGECONFIG FLAGS")) + print header + print str("").ljust(len(header), '=') + for pkgname in sorted(pkg_dict): + print('%-*s%s' % (pkgname_len, pkgname, ' '.join(pkg_dict[pkgname]))) + + +def display_flags(flag_dict): + ''' Display available PACKAGECONFIG flags and all affected pkgs ''' + flag_len = len("PACKAGECONFIG FLAG") + 5 + + header = '%-*s%s' % (flag_len, str("PACKAGECONFIG FLAG"), str("PACKAGE NAMES")) + print header + print str("").ljust(len(header), '=') + + for flag in sorted(flag_dict): + print('%-*s%s' % (flag_len, flag, ' '.join(sorted(flag_dict[flag])))) + +def display_all(data_dict): + ''' Display all pkgs and PACKAGECONFIG information ''' + print str("").ljust(50, '=') + for fn in data_dict: + print('%s' % data_dict[fn].getVar("P", True)) + print fn + packageconfig = data_dict[fn].getVar("PACKAGECONFIG", True) or '' + if packageconfig.strip() == '': + packageconfig = 'None' + print('PACKAGECONFIG %s' % packageconfig) + + for flag,flag_val in data_dict[fn].getVarFlags("PACKAGECONFIG").iteritems(): + if flag == "defaultval": + continue + print('PACKAGECONFIG[%s] %s' % (flag, flag_val)) + print '' + +def main(): + listtype = 'pkgs' + preferred = False + pkg_dict = {} + flag_dict = {} + + # Collect and validate input + try: + opts, args = getopt.getopt(sys.argv[1:], "hfap", ["help", "flag", "all", "prefer"]) + except getopt.GetoptError, err: + print >> sys.stderr,'%s' % str(err) + usage() + sys.exit(2) + for opt, value in opts: + if opt in ('-h', '--help'): + usage() + sys.exit(0) + elif opt in ('-f', '--flag'): + listtype = 'flags' + elif opt in ('-a', '--all'): + listtype = 'all' + elif opt in ('-p', '--prefer'): + preferred = True + else: + assert False, "unhandled option" + + bbhandler = bb.tinfoil.Tinfoil() + bbhandler.prepare() + data_dict = get_recipesdata(bbhandler, preferred) + + if listtype == 'flags': + pkg_dict = collect_pkgs(data_dict) + flag_dict = collect_flags(pkg_dict) + display_flags(flag_dict) + elif listtype == 'pkgs': + pkg_dict = collect_pkgs(data_dict) + display_pkgs(pkg_dict) + elif listtype == 'all': + display_all(data_dict) + +if __name__ == "__main__": + main() diff --git a/scripts/contrib/mkefidisk.sh b/scripts/contrib/mkefidisk.sh new file mode 100755 index 0000000000..c86849d395 --- /dev/null +++ b/scripts/contrib/mkefidisk.sh @@ -0,0 +1,286 @@ +#!/bin/sh +# +# Copyright (c) 2012, Intel Corporation. +# All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +# the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +LANG=C + +# +# Defaults +# +# 20 Mb for the boot partition +BOOT_SIZE=20 +# 5% for swap +SWAP_RATIO=5 + +usage() { + echo "Usage: $(basename $0) DEVICE HDDIMG TARGET_DEVICE" + echo " DEVICE: The device to write the image to, e.g. /dev/sdh" + echo " HDDIMG: The hddimg file to generate the efi disk from" + echo " TARGET_DEVICE: The device the target will boot from, e.g. /dev/mmcblk0" +} + +image_details() { + IMG=$1 + echo "Image details" + echo "=============" + echo " image: $(stat --printf '%N\n' $IMG)" + echo " size: $(stat -L --printf '%s bytes\n' $IMG)" + echo " modified: $(stat -L --printf '%y\n' $IMG)" + echo " type: $(file -L -b $IMG)" + echo "" +} + +device_details() { + DEV=$1 + BLOCK_SIZE=512 + + echo "Device details" + echo "==============" + echo " device: $DEVICE" + if [ -f "/sys/class/block/$DEV/device/vendor" ]; then + echo " vendor: $(cat /sys/class/block/$DEV/device/vendor)" + else + echo " vendor: UNKOWN" + fi + if [ -f "/sys/class/block/$DEV/device/model" ]; then + echo " model: $(cat /sys/class/block/$DEV/device/model)" + else + echo " model: UNKNOWN" + fi + if [ -f "/sys/class/block/$DEV/size" ]; then + echo " size: $(($(cat /sys/class/block/$DEV/size) * $BLOCK_SIZE)) bytes" + else + echo " size: UNKNOWN" + fi + echo "" +} + +unmount_device() { + grep -q $DEVICE /proc/mounts + if [ $? -eq 0 ]; then + echo -n "$DEVICE listed in /proc/mounts, attempting to unmount..." + umount $DEVICE* 2>/dev/null + grep -q $DEVICE /proc/mounts + if [ $? -eq 0 ]; then + echo "FAILED" + exit 1 + fi + echo "OK" + fi +} + + +# +# Parse and validate arguments +# +if [ $# -ne 3 ]; then + usage + exit 1 +fi + +DEVICE=$1 +HDDIMG=$2 +TARGET_DEVICE=$3 + +if [ ! -w "$DEVICE" ]; then + echo "ERROR: Device $DEVICE does not exist or is not writable" + usage + exit 1 +fi + +if [ ! -e "$HDDIMG" ]; then + echo "ERROR: HDDIMG $HDDIMG does not exist" + usage + exit 1 +fi + + +# +# Check if any $DEVICE partitions are mounted +# +unmount_device + + +# +# Confirm device with user +# +image_details $HDDIMG +device_details $(basename $DEVICE) +echo -n "Prepare EFI image on $DEVICE [y/N]? " +read RESPONSE +if [ "$RESPONSE" != "y" ]; then + echo "Image creation aborted" + exit 0 +fi + + +# +# Partition $DEVICE +# +DEVICE_SIZE=$(parted $DEVICE unit mb print | grep ^Disk | cut -d" " -f 3 | sed -e "s/MB//") +# If the device size is not reported there may not be a valid label +if [ "$DEVICE_SIZE" = "" ] ; then + parted $DEVICE mklabel msdos + DEVICE_SIZE=$(parted $DEVICE unit mb print | grep ^Disk | cut -d" " -f 3 | sed -e "s/MB//") +fi +SWAP_SIZE=$((DEVICE_SIZE*SWAP_RATIO/100)) +ROOTFS_SIZE=$((DEVICE_SIZE-BOOT_SIZE-SWAP_SIZE)) +ROOTFS_START=$((BOOT_SIZE)) +ROOTFS_END=$((ROOTFS_START+ROOTFS_SIZE)) +SWAP_START=$((ROOTFS_END)) + +# MMC devices use a partition prefix character 'p' +PART_PREFIX="" +if [ ! "${DEVICE#/dev/mmcblk}" = "${DEVICE}" ] || [ ! "${DEVICE#/dev/loop}" = "${DEVICE}" ]; then + PART_PREFIX="p" +fi +BOOTFS=$DEVICE${PART_PREFIX}1 +ROOTFS=$DEVICE${PART_PREFIX}2 +SWAP=$DEVICE${PART_PREFIX}3 + +TARGET_PART_PREFIX="" +if [ ! "${TARGET_DEVICE#/dev/mmcblk}" = "${TARGET_DEVICE}" ]; then + TARGET_PART_PREFIX="p" +fi +TARGET_ROOTFS=$TARGET_DEVICE${TARGET_PART_PREFIX}2 +TARGET_SWAP=$TARGET_DEVICE${TARGET_PART_PREFIX}3 + +echo "*****************" +echo "Boot partition size: $BOOT_SIZE MB ($BOOTFS)" +echo "ROOTFS partition size: $ROOTFS_SIZE MB ($ROOTFS)" +echo "Swap partition size: $SWAP_SIZE MB ($SWAP)" +echo "*****************" + +echo "Deleting partition table on $DEVICE ..." +dd if=/dev/zero of=$DEVICE bs=512 count=2 + +# Use MSDOS by default as GPT cannot be reliably distributed in disk image form +# as it requires the backup table to be on the last block of the device, which +# of course varies from device to device. +echo "Creating new partition table (MSDOS) on $DEVICE ..." +parted $DEVICE mklabel msdos + +echo "Creating boot partition on $BOOTFS" +parted $DEVICE mkpart primary 0% $BOOT_SIZE + +echo "Enabling boot flag on $BOOTFS" +parted $DEVICE set 1 boot on + +echo "Creating ROOTFS partition on $ROOTFS" +parted $DEVICE mkpart primary $ROOTFS_START $ROOTFS_END + +echo "Creating swap partition on $SWAP" +parted $DEVICE mkpart primary $SWAP_START 100% + +parted $DEVICE print + + +# +# Check if any $DEVICE partitions are mounted after partitioning +# +unmount_device + + +# +# Format $DEVICE partitions +# +echo "" +echo "Formatting $BOOTFS as vfat..." +if [ ! "${DEVICE#/dev/loop}" = "${DEVICE}" ]; then + mkfs.vfat -I $BOOTFS -n "efi" +else + mkfs.vfat $BOOTFS -n "efi" + +fi + +echo "Formatting $ROOTFS as ext3..." +mkfs.ext3 $ROOTFS -L "root" + +echo "Formatting swap partition...($SWAP)" +mkswap $SWAP + + +# +# Installing to $DEVICE +# +echo "" +echo "Mounting images and device in preparation for installation..." +TMPDIR=$(mktemp -d mkefidisk-XXX) +if [ $? -ne 0 ]; then + echo "ERROR: Failed to create temporary mounting directory." + exit 1 +fi +HDDIMG_MNT=$TMPDIR/hddimg +HDDIMG_ROOTFS_MNT=$TMPDIR/hddimg_rootfs +ROOTFS_MNT=$TMPDIR/rootfs +BOOTFS_MNT=$TMPDIR/bootfs +mkdir $HDDIMG_MNT +mkdir $HDDIMG_ROOTFS_MNT +mkdir $ROOTFS_MNT +mkdir $BOOTFS_MNT + +mount -o loop $HDDIMG $HDDIMG_MNT +mount -o loop $HDDIMG_MNT/rootfs.img $HDDIMG_ROOTFS_MNT +mount $ROOTFS $ROOTFS_MNT +mount $BOOTFS $BOOTFS_MNT + +echo "Copying ROOTFS files..." +cp -a $HDDIMG_ROOTFS_MNT/* $ROOTFS_MNT + +echo "$TARGET_SWAP swap swap defaults 0 0" >> $ROOTFS_MNT/etc/fstab + +# We dont want udev to mount our root device while we're booting... +if [ -d $ROOTFS_MNT/etc/udev/ ] ; then + echo "$TARGET_DEVICE" >> $ROOTFS_MNT/etc/udev/mount.blacklist +fi + +umount $ROOTFS_MNT +umount $HDDIMG_ROOTFS_MNT + +echo "Preparing boot partition..." +EFIDIR="$BOOTFS_MNT/EFI/BOOT" +mkdir -p $EFIDIR +GRUBCFG="$EFIDIR/grub.cfg" + +cp $HDDIMG_MNT/vmlinuz $BOOTFS_MNT +# Copy the efi loader and config (booti*.efi and grub.cfg) +cp $HDDIMG_MNT/EFI/BOOT/* $EFIDIR + +# Update grub config for the installed image +# Delete the install entry +sed -i "/menuentry 'install'/,/^}/d" $GRUBCFG +# Delete the initrd lines +sed -i "/initrd /d" $GRUBCFG +# Delete any LABEL= strings +sed -i "s/ LABEL=[^ ]*/ /" $GRUBCFG +# Remove any existing root= kernel parameters and: +# o Add a root= parameter with the target rootfs +# o Specify ro so fsck can be run during boot +# o Specify rootwait in case the target media is an asyncronous block device +# such as MMC or USB disks +# o Specify "quiet" to minimize boot time when using slow serial consoles +sed -i "s@ root=[^ ]*@ @" $GRUBCFG +sed -i "s@vmlinuz @vmlinuz root=$TARGET_ROOTFS ro rootwait quiet @" $GRUBCFG + +umount $BOOTFS_MNT +umount $HDDIMG_MNT +rm -rf $TMPDIR +sync + +echo "Installation complete." diff --git a/scripts/contrib/python/generate-manifest-2.7.py b/scripts/contrib/python/generate-manifest-2.7.py new file mode 100755 index 0000000000..4356ad0ddd --- /dev/null +++ b/scripts/contrib/python/generate-manifest-2.7.py @@ -0,0 +1,388 @@ +#!/usr/bin/env python + +# generate Python Manifest for the OpenEmbedded build system +# (C) 2002-2010 Michael 'Mickey' Lauer +# (C) 2007 Jeremy Laine +# licensed under MIT, see COPYING.MIT +# +# June 22, 2011 -- Mark Hatle +# * Updated to no longer generate special -dbg package, instead use the +# single system -dbg +# * Update version with ".1" to indicate this change + +import os +import sys +import time + +VERSION = "2.7.2" + +__author__ = "Michael 'Mickey' Lauer " +__version__ = "20110222.2" + +class MakefileMaker: + + def __init__( self, outfile ): + """initialize""" + self.packages = {} + self.targetPrefix = "${libdir}/python%s/" % VERSION[:3] + self.output = outfile + self.out( """ +# WARNING: This file is AUTO GENERATED: Manual edits will be lost next time I regenerate the file. +# Generator: '%s' Version %s (C) 2002-2010 Michael 'Mickey' Lauer +# Visit the Python for Embedded Systems Site => http://www.Vanille.de/projects/python.spy +""" % ( sys.argv[0], __version__ ) ) + + # + # helper functions + # + + def out( self, data ): + """print a line to the output file""" + self.output.write( "%s\n" % data ) + + def setPrefix( self, targetPrefix ): + """set a file prefix for addPackage files""" + self.targetPrefix = targetPrefix + + def doProlog( self ): + self.out( """ """ ) + self.out( "" ) + + def addPackage( self, name, description, dependencies, filenames ): + """add a package to the Makefile""" + if type( filenames ) == type( "" ): + filenames = filenames.split() + fullFilenames = [] + for filename in filenames: + if filename[0] != "$": + fullFilenames.append( "%s%s" % ( self.targetPrefix, filename ) ) + else: + fullFilenames.append( filename ) + self.packages[name] = description, dependencies, fullFilenames + + def doBody( self ): + """generate body of Makefile""" + + global VERSION + + # + # generate provides line + # + + provideLine = 'PROVIDES+="' + for name in sorted(self.packages): + provideLine += "%s " % name + provideLine += '"' + + self.out( provideLine ) + self.out( "" ) + + # + # generate package line + # + + packageLine = 'PACKAGES="${PN}-dbg ' + for name in sorted(self.packages): + if name.startswith("${PN}-distutils"): + if name == "${PN}-distutils": + packageLine += "%s-staticdev %s " % (name, name) + elif name != '${PN}-dbg': + packageLine += "%s " % name + packageLine += '${PN}-modules"' + + self.out( packageLine ) + self.out( "" ) + + # + # generate package variables + # + + for name, data in sorted(self.packages.iteritems()): + desc, deps, files = data + + # + # write out the description, revision and dependencies + # + self.out( 'SUMMARY_%s="%s"' % ( name, desc ) ) + self.out( 'RDEPENDS_%s="%s"' % ( name, deps ) ) + + line = 'FILES_%s="' % name + + # + # check which directories to make in the temporary directory + # + + dirset = {} # if python had a set-datatype this would be sufficient. for now, we're using a dict instead. + for target in files: + dirset[os.path.dirname( target )] = True + + # + # generate which files to copy for the target (-dfR because whole directories are also allowed) + # + + for target in files: + line += "%s " % target + + line += '"' + self.out( line ) + self.out( "" ) + + self.out( 'SUMMARY_${PN}-modules="All Python modules"' ) + line = 'RDEPENDS_${PN}-modules="' + + for name, data in sorted(self.packages.iteritems()): + if name not in ['${PN}-dev', '${PN}-distutils-staticdev']: + line += "%s " % name + + self.out( "%s \"" % line ) + self.out( 'ALLOW_EMPTY_${PN}-modules = "1"' ) + + def doEpilog( self ): + self.out( """""" ) + self.out( "" ) + + def make( self ): + self.doProlog() + self.doBody() + self.doEpilog() + +if __name__ == "__main__": + + if len( sys.argv ) > 1: + try: + os.unlink(sys.argv[1]) + except Exception: + sys.exc_clear() + outfile = file( sys.argv[1], "w" ) + else: + outfile = sys.stdout + + m = MakefileMaker( outfile ) + + # Add packages here. Only specify dlopen-style library dependencies here, no ldd-style dependencies! + # Parameters: revision, name, description, dependencies, filenames + # + + m.addPackage( "${PN}-core", "Python interpreter and core modules", "${PN}-lang ${PN}-re", + "__future__.* _abcoll.* abc.* copy.* copy_reg.* ConfigParser.* " + + "genericpath.* getopt.* linecache.* new.* " + + "os.* posixpath.* struct.* " + + "warnings.* site.* stat.* " + + "UserDict.* UserList.* UserString.* " + + "lib-dynload/binascii.so lib-dynload/_struct.so lib-dynload/time.so " + + "lib-dynload/xreadlines.so types.* platform.* ${bindir}/python* " + + "_weakrefset.* sysconfig.* config/Makefile " + + "${includedir}/python${PYTHON_MAJMIN}/pyconfig*.h " + + "${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py ") + + m.addPackage( "${PN}-dev", "Python development package", "${PN}-core", + "${includedir} " + + "${libdir}/lib*${SOLIBSDEV} " + + "${libdir}/*.la " + + "${libdir}/*.a " + + "${libdir}/*.o " + + "${libdir}/pkgconfig " + + "${base_libdir}/*.a " + + "${base_libdir}/*.o " + + "${datadir}/aclocal " + + "${datadir}/pkgconfig " ) + + m.addPackage( "${PN}-2to3", "Python automated Python 2 to 3 code translator", "${PN}-core", + "${bindir}/2to3 lib2to3" ) # package + + m.addPackage( "${PN}-idle", "Python Integrated Development Environment", "${PN}-core ${PN}-tkinter", + "${bindir}/idle idlelib" ) # package + + m.addPackage( "${PN}-pydoc", "Python interactive help support", "${PN}-core ${PN}-lang ${PN}-stringold ${PN}-re", + "${bindir}/pydoc pydoc.* pydoc_data" ) + + m.addPackage( "${PN}-smtpd", "Python Simple Mail Transport Daemon", "${PN}-core ${PN}-netserver ${PN}-email ${PN}-mime", + "${bindir}/smtpd.* smtpd.*" ) + + m.addPackage( "${PN}-audio", "Python Audio Handling", "${PN}-core", + "wave.* chunk.* sndhdr.* lib-dynload/ossaudiodev.so lib-dynload/audioop.so audiodev.* sunaudio.* sunau.* toaiff.*" ) + + m.addPackage( "${PN}-bsddb", "Python bindings for the Berkeley Database", "${PN}-core", + "bsddb lib-dynload/_bsddb.so" ) # package + + m.addPackage( "${PN}-codecs", "Python codecs, encodings & i18n support", "${PN}-core ${PN}-lang", + "codecs.* encodings gettext.* locale.* lib-dynload/_locale.so lib-dynload/_codecs* lib-dynload/_multibytecodec.so lib-dynload/unicodedata.so stringprep.* xdrlib.*" ) + + m.addPackage( "${PN}-compile", "Python bytecode compilation support", "${PN}-core", + "py_compile.* compileall.*" ) + + m.addPackage( "${PN}-compiler", "Python compiler support", "${PN}-core", + "compiler" ) # package + + m.addPackage( "${PN}-compression", "Python high-level compression support", "${PN}-core ${PN}-zlib", + "gzip.* zipfile.* tarfile.* lib-dynload/bz2.so" ) + + m.addPackage( "${PN}-crypt", "Python basic cryptographic and hashing support", "${PN}-core", + "hashlib.* md5.* sha.* lib-dynload/crypt.so lib-dynload/_hashlib.so lib-dynload/_sha256.so lib-dynload/_sha512.so" ) + + m.addPackage( "${PN}-textutils", "Python option parsing, text wrapping and CSV support", "${PN}-core ${PN}-io ${PN}-re ${PN}-stringold", + "lib-dynload/_csv.so csv.* optparse.* textwrap.*" ) + + m.addPackage( "${PN}-curses", "Python curses support", "${PN}-core", + "curses lib-dynload/_curses.so lib-dynload/_curses_panel.so" ) # directory + low level module + + m.addPackage( "${PN}-ctypes", "Python C types support", "${PN}-core", + "ctypes lib-dynload/_ctypes.so lib-dynload/_ctypes_test.so" ) # directory + low level module + + m.addPackage( "${PN}-datetime", "Python calendar and time support", "${PN}-core ${PN}-codecs", + "_strptime.* calendar.* lib-dynload/datetime.so" ) + + m.addPackage( "${PN}-db", "Python file-based database support", "${PN}-core", + "anydbm.* dumbdbm.* whichdb.* " ) + + m.addPackage( "${PN}-debugger", "Python debugger", "${PN}-core ${PN}-io ${PN}-lang ${PN}-re ${PN}-stringold ${PN}-shell ${PN}-pprint", + "bdb.* pdb.*" ) + + m.addPackage( "${PN}-difflib", "Python helpers for computing deltas between objects", "${PN}-lang ${PN}-re", + "difflib.*" ) + + m.addPackage( "${PN}-distutils-staticdev", "Python distribution utilities (static libraries)", "${PN}-distutils", + "config/lib*.a" ) # package + + m.addPackage( "${PN}-distutils", "Python Distribution Utilities", "${PN}-core", + "config distutils" ) # package + + m.addPackage( "${PN}-doctest", "Python framework for running examples in docstrings", "${PN}-core ${PN}-lang ${PN}-io ${PN}-re ${PN}-unittest ${PN}-debugger ${PN}-difflib", + "doctest.*" ) + + # FIXME consider adding to some higher level package + m.addPackage( "${PN}-elementtree", "Python elementree", "${PN}-core", + "lib-dynload/_elementtree.so" ) + + m.addPackage( "${PN}-email", "Python email support", "${PN}-core ${PN}-io ${PN}-re ${PN}-mime ${PN}-audio ${PN}-image ${PN}-netclient", + "imaplib.* email" ) # package + + m.addPackage( "${PN}-fcntl", "Python's fcntl interface", "${PN}-core", + "lib-dynload/fcntl.so" ) + + m.addPackage( "${PN}-hotshot", "Python hotshot performance profiler", "${PN}-core", + "hotshot lib-dynload/_hotshot.so" ) + + m.addPackage( "${PN}-html", "Python HTML processing support", "${PN}-core", + "formatter.* htmlentitydefs.* htmllib.* markupbase.* sgmllib.* HTMLParser.* " ) + + m.addPackage( "${PN}-gdbm", "Python GNU database support", "${PN}-core", + "lib-dynload/gdbm.so" ) + + m.addPackage( "${PN}-image", "Python graphical image handling", "${PN}-core", + "colorsys.* imghdr.* lib-dynload/imageop.so lib-dynload/rgbimg.so" ) + + m.addPackage( "${PN}-io", "Python low-level I/O", "${PN}-core ${PN}-math ${PN}-textutils", + "lib-dynload/_socket.so lib-dynload/_io.so lib-dynload/_ssl.so lib-dynload/select.so lib-dynload/termios.so lib-dynload/cStringIO.so " + + "pipes.* socket.* ssl.* tempfile.* StringIO.* io.* _pyio.*" ) + + m.addPackage( "${PN}-json", "Python JSON support", "${PN}-core ${PN}-math ${PN}-re", + "json lib-dynload/_json.so" ) # package + + m.addPackage( "${PN}-lang", "Python low-level language support", "${PN}-core", + "lib-dynload/_bisect.so lib-dynload/_collections.so lib-dynload/_heapq.so lib-dynload/_weakref.so lib-dynload/_functools.so " + + "lib-dynload/array.so lib-dynload/itertools.so lib-dynload/operator.so lib-dynload/parser.so " + + "atexit.* bisect.* code.* codeop.* collections.* dis.* functools.* heapq.* inspect.* keyword.* opcode.* symbol.* repr.* token.* " + + "tokenize.* traceback.* weakref.*" ) + + m.addPackage( "${PN}-logging", "Python logging support", "${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-stringold", + "logging" ) # package + + m.addPackage( "${PN}-mailbox", "Python mailbox format support", "${PN}-core ${PN}-mime", + "mailbox.*" ) + + m.addPackage( "${PN}-math", "Python math support", "${PN}-core ${PN}-crypt", + "lib-dynload/cmath.so lib-dynload/math.so lib-dynload/_random.so random.* sets.*" ) + + m.addPackage( "${PN}-mime", "Python MIME handling APIs", "${PN}-core ${PN}-io", + "mimetools.* uu.* quopri.* rfc822.* MimeWriter.*" ) + + m.addPackage( "${PN}-mmap", "Python memory-mapped file support", "${PN}-core ${PN}-io", + "lib-dynload/mmap.so " ) + + m.addPackage( "${PN}-multiprocessing", "Python multiprocessing support", "${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-threading ${PN}-ctypes ${PN}-mmap", + "lib-dynload/_multiprocessing.so multiprocessing" ) # package + + m.addPackage( "${PN}-netclient", "Python Internet Protocol clients", "${PN}-core ${PN}-crypt ${PN}-datetime ${PN}-io ${PN}-lang ${PN}-logging ${PN}-mime", + "*Cookie*.* " + + "base64.* cookielib.* ftplib.* gopherlib.* hmac.* httplib.* mimetypes.* nntplib.* poplib.* smtplib.* telnetlib.* urllib.* urllib2.* urlparse.* uuid.* rfc822.* mimetools.*" ) + + m.addPackage( "${PN}-netserver", "Python Internet Protocol servers", "${PN}-core ${PN}-netclient", + "cgi.* *HTTPServer.* SocketServer.*" ) + + m.addPackage( "${PN}-numbers", "Python number APIs", "${PN}-core ${PN}-lang ${PN}-re", + "decimal.* numbers.*" ) + + m.addPackage( "${PN}-pickle", "Python serialisation/persistence support", "${PN}-core ${PN}-codecs ${PN}-io ${PN}-re", + "pickle.* shelve.* lib-dynload/cPickle.so pickletools.*" ) + + m.addPackage( "${PN}-pkgutil", "Python package extension utility support", "${PN}-core", + "pkgutil.*") + + m.addPackage( "${PN}-pprint", "Python pretty-print support", "${PN}-core ${PN}-io", + "pprint.*" ) + + m.addPackage( "${PN}-profile", "Python basic performance profiling support", "${PN}-core ${PN}-textutils", + "profile.* pstats.* cProfile.* lib-dynload/_lsprof.so" ) + + m.addPackage( "${PN}-re", "Python Regular Expression APIs", "${PN}-core", + "re.* sre.* sre_compile.* sre_constants* sre_parse.*" ) # _sre is builtin + + m.addPackage( "${PN}-readline", "Python readline support", "${PN}-core", + "lib-dynload/readline.so rlcompleter.*" ) + + m.addPackage( "${PN}-resource", "Python resource control interface", "${PN}-core", + "lib-dynload/resource.so" ) + + m.addPackage( "${PN}-shell", "Python shell-like functionality", "${PN}-core ${PN}-re", + "cmd.* commands.* dircache.* fnmatch.* glob.* popen2.* shlex.* shutil.*" ) + + m.addPackage( "${PN}-robotparser", "Python robots.txt parser", "${PN}-core ${PN}-netclient", + "robotparser.*") + + m.addPackage( "${PN}-subprocess", "Python subprocess support", "${PN}-core ${PN}-io ${PN}-re ${PN}-fcntl ${PN}-pickle", + "subprocess.*" ) + + m.addPackage( "${PN}-sqlite3", "Python Sqlite3 database support", "${PN}-core ${PN}-datetime ${PN}-lang ${PN}-crypt ${PN}-io ${PN}-threading ${PN}-zlib", + "lib-dynload/_sqlite3.so sqlite3/dbapi2.* sqlite3/__init__.* sqlite3/dump.*" ) + + m.addPackage( "${PN}-sqlite3-tests", "Python Sqlite3 database support tests", "${PN}-core ${PN}-sqlite3", + "sqlite3/test" ) + + m.addPackage( "${PN}-stringold", "Python string APIs [deprecated]", "${PN}-core ${PN}-re", + "lib-dynload/strop.so string.* stringold.*" ) + + m.addPackage( "${PN}-syslog", "Python syslog interface", "${PN}-core", + "lib-dynload/syslog.so" ) + + m.addPackage( "${PN}-terminal", "Python terminal controlling support", "${PN}-core ${PN}-io", + "pty.* tty.*" ) + + m.addPackage( "${PN}-tests", "Python tests", "${PN}-core", + "test" ) # package + + m.addPackage( "${PN}-threading", "Python threading & synchronization support", "${PN}-core ${PN}-lang", + "_threading_local.* dummy_thread.* dummy_threading.* mutex.* threading.* Queue.*" ) + + m.addPackage( "${PN}-tkinter", "Python Tcl/Tk bindings", "${PN}-core", + "lib-dynload/_tkinter.so lib-tk" ) # package + + m.addPackage( "${PN}-unittest", "Python unit testing framework", "${PN}-core ${PN}-stringold ${PN}-lang ${PN}-io ${PN}-difflib ${PN}-pprint ${PN}-shell", + "unittest/" ) + + m.addPackage( "${PN}-unixadmin", "Python Unix administration support", "${PN}-core", + "lib-dynload/nis.so lib-dynload/grp.so lib-dynload/pwd.so getpass.*" ) + + m.addPackage( "${PN}-xml", "Python basic XML support", "${PN}-core ${PN}-elementtree ${PN}-re", + "lib-dynload/pyexpat.so xml xmllib.*" ) # package + + m.addPackage( "${PN}-xmlrpc", "Python XML-RPC support", "${PN}-core ${PN}-xml ${PN}-netserver ${PN}-lang", + "xmlrpclib.* SimpleXMLRPCServer.* DocXMLRPCServer.*" ) + + m.addPackage( "${PN}-zlib", "Python zlib compression support", "${PN}-core", + "lib-dynload/zlib.so" ) + + m.addPackage( "${PN}-mailbox", "Python mailbox format support", "${PN}-core ${PN}-mime", + "mailbox.*" ) + + m.make() diff --git a/scripts/contrib/python/generate-manifest-3.3.py b/scripts/contrib/python/generate-manifest-3.3.py new file mode 100755 index 0000000000..1586c46868 --- /dev/null +++ b/scripts/contrib/python/generate-manifest-3.3.py @@ -0,0 +1,380 @@ +#!/usr/bin/env python + +# generate Python Manifest for the OpenEmbedded build system +# (C) 2002-2010 Michael 'Mickey' Lauer +# (C) 2007 Jeremy Laine +# licensed under MIT, see COPYING.MIT +# +# June 22, 2011 -- Mark Hatle +# * Updated to no longer generate special -dbg package, instead use the +# single system -dbg +# * Update version with ".1" to indicate this change +# +# 2014 Khem Raj +# Added python3 support +# +import os +import sys +import time + +VERSION = "3.3.3" + +__author__ = "Michael 'Mickey' Lauer " +__version__ = "20140131" + +class MakefileMaker: + + def __init__( self, outfile ): + """initialize""" + self.packages = {} + self.targetPrefix = "${libdir}/python%s/" % VERSION[:3] + self.output = outfile + self.out( """ +# WARNING: This file is AUTO GENERATED: Manual edits will be lost next time I regenerate the file. +# Generator: '%s' Version %s (C) 2002-2010 Michael 'Mickey' Lauer +# Visit the Python for Embedded Systems Site => http://www.Vanille.de/projects/python.spy +""" % ( sys.argv[0], __version__ ) ) + + # + # helper functions + # + + def out( self, data ): + """print a line to the output file""" + self.output.write( "%s\n" % data ) + + def setPrefix( self, targetPrefix ): + """set a file prefix for addPackage files""" + self.targetPrefix = targetPrefix + + def doProlog( self ): + self.out( """ """ ) + self.out( "" ) + + def addPackage( self, name, description, dependencies, filenames ): + """add a package to the Makefile""" + if type( filenames ) == type( "" ): + filenames = filenames.split() + fullFilenames = [] + for filename in filenames: + if filename[0] != "$": + fullFilenames.append( "%s%s" % ( self.targetPrefix, filename ) ) + else: + fullFilenames.append( filename ) + self.packages[name] = description, dependencies, fullFilenames + + def doBody( self ): + """generate body of Makefile""" + + global VERSION + + # + # generate provides line + # + + provideLine = 'PROVIDES+="' + for name in sorted(self.packages): + provideLine += "%s " % name + provideLine += '"' + + self.out( provideLine ) + self.out( "" ) + + # + # generate package line + # + + packageLine = 'PACKAGES="${PN}-dbg ' + for name in sorted(self.packages): + if name.startswith("${PN}-distutils"): + if name == "${PN}-distutils": + packageLine += "%s-staticdev %s " % (name, name) + elif name != '${PN}-dbg': + packageLine += "%s " % name + packageLine += '${PN}-modules"' + + self.out( packageLine ) + self.out( "" ) + + # + # generate package variables + # + + for name, data in sorted(self.packages.iteritems()): + desc, deps, files = data + + # + # write out the description, revision and dependencies + # + self.out( 'SUMMARY_%s="%s"' % ( name, desc ) ) + self.out( 'RDEPENDS_%s="%s"' % ( name, deps ) ) + + line = 'FILES_%s="' % name + + # + # check which directories to make in the temporary directory + # + + dirset = {} # if python had a set-datatype this would be sufficient. for now, we're using a dict instead. + for target in files: + dirset[os.path.dirname( target )] = True + + # + # generate which files to copy for the target (-dfR because whole directories are also allowed) + # + + for target in files: + line += "%s " % target + + line += '"' + self.out( line ) + self.out( "" ) + + self.out( 'SUMMARY_${PN}-modules="All Python modules"' ) + line = 'RDEPENDS_${PN}-modules="' + + for name, data in sorted(self.packages.iteritems()): + if name not in ['${PN}-dev', '${PN}-distutils-staticdev']: + line += "%s " % name + + self.out( "%s \"" % line ) + self.out( 'ALLOW_EMPTY_${PN}-modules = "1"' ) + + def doEpilog( self ): + self.out( """""" ) + self.out( "" ) + + def make( self ): + self.doProlog() + self.doBody() + self.doEpilog() + +if __name__ == "__main__": + + if len( sys.argv ) > 1: + try: + os.unlink(sys.argv[1]) + except Exception: + sys.exc_clear() + outfile = file( sys.argv[1], "w" ) + else: + outfile = sys.stdout + + m = MakefileMaker( outfile ) + + # Add packages here. Only specify dlopen-style library dependencies here, no ldd-style dependencies! + # Parameters: revision, name, description, dependencies, filenames + # + + m.addPackage( "${PN}-core", "Python interpreter and core modules", "${PN}-lang ${PN}-re", + "__future__.* _abcoll.* abc.* copy.* copy_reg.* ConfigParser.* " + + "genericpath.* getopt.* linecache.* new.* " + + "os.* posixpath.* struct.* " + + "warnings.* site.* stat.* " + + "UserDict.* UserList.* UserString.* " + + "lib-dynload/binascii.*.so lib-dynload/_struct.*.so lib-dynload/time.*.so " + + "lib-dynload/xreadlines.*.so types.* platform.* ${bindir}/python* " + + "_weakrefset.* sysconfig.* config/Makefile " + + "${includedir}/python${PYTHON_MAJMIN}/pyconfig*.h " + + "${libdir}/python${PYTHON_MAJMIN}/collections " + + "${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py ") + + m.addPackage( "${PN}-dev", "Python development package", "${PN}-core", + "${includedir} " + + "${libdir}/lib*${SOLIBSDEV} " + + "${libdir}/*.la " + + "${libdir}/*.a " + + "${libdir}/*.o " + + "${libdir}/pkgconfig " + + "${base_libdir}/*.a " + + "${base_libdir}/*.o " + + "${datadir}/aclocal " + + "${datadir}/pkgconfig " ) + + m.addPackage( "${PN}-2to3", "Python automated Python 2 to 3 code translator", "${PN}-core", + "${bindir}/2to3 lib2to3" ) # package + + m.addPackage( "${PN}-idle", "Python Integrated Development Environment", "${PN}-core ${PN}-tkinter", + "${bindir}/idle idlelib" ) # package + + m.addPackage( "${PN}-pydoc", "Python interactive help support", "${PN}-core ${PN}-lang ${PN}-stringold ${PN}-re", + "${bindir}/pydoc pydoc.* pydoc_data" ) + + m.addPackage( "${PN}-smtpd", "Python Simple Mail Transport Daemon", "${PN}-core ${PN}-netserver ${PN}-email ${PN}-mime", + "${bindir}/smtpd.* smtpd.*" ) + + m.addPackage( "${PN}-audio", "Python Audio Handling", "${PN}-core", + "wave.* chunk.* sndhdr.* lib-dynload/ossaudiodev.*.so lib-dynload/audioop.*.so audiodev.* sunaudio.* sunau.* toaiff.*" ) + + m.addPackage( "${PN}-codecs", "Python codecs, encodings & i18n support", "${PN}-core ${PN}-lang", + "codecs.* encodings gettext.* locale.* lib-dynload/_locale.*.so lib-dynload/_codecs* lib-dynload/_multibytecodec.*.so lib-dynload/unicodedata.*.so stringprep.* xdrlib.*" ) + + m.addPackage( "${PN}-compile", "Python bytecode compilation support", "${PN}-core", + "py_compile.* compileall.*" ) + + m.addPackage( "${PN}-compression", "Python high-level compression support", "${PN}-core ${PN}-codecs", + "gzip.* zipfile.* tarfile.* lib-dynload/bz2.*.so" ) + + m.addPackage( "${PN}-crypt", "Python basic cryptographic and hashing support", "${PN}-core", + "hashlib.* md5.* sha.* lib-dynload/crypt.*.so lib-dynload/_hashlib.*.so lib-dynload/_sha256.*.so lib-dynload/_sha512.*.so" ) + + m.addPackage( "${PN}-textutils", "Python option parsing, text wrapping and CSV support", "${PN}-core ${PN}-io ${PN}-re ${PN}-stringold", + "lib-dynload/_csv.*.so csv.* optparse.* textwrap.*" ) + + m.addPackage( "${PN}-curses", "Python curses support", "${PN}-core", + "curses lib-dynload/_curses.*.so lib-dynload/_curses_panel.*.so" ) # directory + low level module + + m.addPackage( "${PN}-ctypes", "Python C types support", "${PN}-core", + "ctypes lib-dynload/_ctypes.*.so lib-dynload/_ctypes_test.*.so" ) # directory + low level module + + m.addPackage( "${PN}-datetime", "Python calendar and time support", "${PN}-core ${PN}-codecs", + "_strptime.* calendar.* lib-dynload/datetime.*.so" ) + + m.addPackage( "${PN}-db", "Python file-based database support", "${PN}-core", + "anydbm.* dumbdbm.* whichdb.* dbm lib-dynload/_dbm.*.so" ) + + m.addPackage( "${PN}-debugger", "Python debugger", "${PN}-core ${PN}-io ${PN}-lang ${PN}-re ${PN}-stringold ${PN}-shell ${PN}-pprint", + "bdb.* pdb.*" ) + + m.addPackage( "${PN}-difflib", "Python helpers for computing deltas between objects", "${PN}-lang ${PN}-re", + "difflib.*" ) + + m.addPackage( "${PN}-distutils-staticdev", "Python distribution utilities (static libraries)", "${PN}-distutils", + "config/lib*.a" ) # package + + m.addPackage( "${PN}-distutils", "Python Distribution Utilities", "${PN}-core", + "config distutils" ) # package + + m.addPackage( "${PN}-doctest", "Python framework for running examples in docstrings", "${PN}-core ${PN}-lang ${PN}-io ${PN}-re ${PN}-unittest ${PN}-debugger ${PN}-difflib", + "doctest.*" ) + + # FIXME consider adding to some higher level package + m.addPackage( "${PN}-elementtree", "Python elementree", "${PN}-core", + "lib-dynload/_elementtree.*.so" ) + + m.addPackage( "${PN}-email", "Python email support", "${PN}-core ${PN}-io ${PN}-re ${PN}-mime ${PN}-audio ${PN}-image ${PN}-netclient", + "imaplib.* email" ) # package + + m.addPackage( "${PN}-fcntl", "Python's fcntl interface", "${PN}-core", + "lib-dynload/fcntl.*.so" ) + + m.addPackage( "${PN}-html", "Python HTML processing support", "${PN}-core", + "formatter.* htmlentitydefs.* htmllib.* markupbase.* sgmllib.* HTMLParser.* " ) + + m.addPackage( "${PN}-gdbm", "Python GNU database support", "${PN}-core", + "lib-dynload/_gdbm.*.so" ) + + m.addPackage( "${PN}-image", "Python graphical image handling", "${PN}-core", + "colorsys.* imghdr.* lib-dynload/imageop.*.so lib-dynload/rgbimg.*.so" ) + + m.addPackage( "${PN}-io", "Python low-level I/O", "${PN}-core ${PN}-math", + "lib-dynload/_socket.*.so lib-dynload/_io.*.so lib-dynload/_ssl.*.so lib-dynload/select.*.so lib-dynload/termios.*.so lib-dynload/cStringIO.*.so " + + "pipes.* socket.* ssl.* tempfile.* StringIO.* io.* _pyio.*" ) + + m.addPackage( "${PN}-json", "Python JSON support", "${PN}-core ${PN}-math ${PN}-re", + "json lib-dynload/_json.*.so" ) # package + + m.addPackage( "${PN}-lang", "Python low-level language support", "${PN}-core", + "lib-dynload/_bisect.*.so lib-dynload/_collections.*.so lib-dynload/_heapq.*.so lib-dynload/_weakref.*.so lib-dynload/_functools.*.so " + + "lib-dynload/array.*.so lib-dynload/itertools.*.so lib-dynload/operator.*.so lib-dynload/parser.*.so " + + "atexit.* bisect.* code.* codeop.* collections.* dis.* functools.* heapq.* inspect.* keyword.* opcode.* symbol.* repr.* token.* " + + "tokenize.* traceback.* weakref.*" ) + + m.addPackage( "${PN}-logging", "Python logging support", "${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-stringold", + "logging" ) # package + + m.addPackage( "${PN}-mailbox", "Python mailbox format support", "${PN}-core ${PN}-mime", + "mailbox.*" ) + + m.addPackage( "${PN}-math", "Python math support", "${PN}-core", + "lib-dynload/cmath.*.so lib-dynload/math.*.so lib-dynload/_random.*.so random.* sets.*" ) + + m.addPackage( "${PN}-mime", "Python MIME handling APIs", "${PN}-core ${PN}-io", + "mimetools.* uu.* quopri.* rfc822.* MimeWriter.*" ) + + m.addPackage( "${PN}-mmap", "Python memory-mapped file support", "${PN}-core ${PN}-io", + "lib-dynload/mmap.*.so " ) + + m.addPackage( "${PN}-multiprocessing", "Python multiprocessing support", "${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-threading ${PN}-ctypes ${PN}-mmap", + "lib-dynload/_multiprocessing.*.so multiprocessing" ) # package + + m.addPackage( "${PN}-netclient", "Python Internet Protocol clients", "${PN}-core ${PN}-crypt ${PN}-datetime ${PN}-io ${PN}-lang ${PN}-logging ${PN}-mime", + "*Cookie*.* " + + "base64.* cookielib.* ftplib.* gopherlib.* hmac.* httplib.* mimetypes.* nntplib.* poplib.* smtplib.* telnetlib.* urllib.* urllib2.* urlparse.* uuid.* rfc822.* mimetools.*" ) + + m.addPackage( "${PN}-netserver", "Python Internet Protocol servers", "${PN}-core ${PN}-netclient", + "cgi.* *HTTPServer.* SocketServer.*" ) + + m.addPackage( "${PN}-numbers", "Python number APIs", "${PN}-core ${PN}-lang ${PN}-re", + "decimal.* numbers.*" ) + + m.addPackage( "${PN}-pickle", "Python serialisation/persistence support", "${PN}-core ${PN}-codecs ${PN}-io ${PN}-re", + "pickle.* shelve.* lib-dynload/cPickle.*.so pickletools.*" ) + + m.addPackage( "${PN}-pkgutil", "Python package extension utility support", "${PN}-core", + "pkgutil.*") + + m.addPackage( "${PN}-pprint", "Python pretty-print support", "${PN}-core ${PN}-io", + "pprint.*" ) + + m.addPackage( "${PN}-profile", "Python basic performance profiling support", "${PN}-core ${PN}-textutils", + "profile.* pstats.* cProfile.* lib-dynload/_lsprof.*.so" ) + + m.addPackage( "${PN}-re", "Python Regular Expression APIs", "${PN}-core", + "re.* sre.* sre_compile.* sre_constants* sre_parse.*" ) # _sre is builtin + + m.addPackage( "${PN}-readline", "Python readline support", "${PN}-core", + "lib-dynload/readline.*.so rlcompleter.*" ) + + m.addPackage( "${PN}-resource", "Python resource control interface", "${PN}-core", + "lib-dynload/resource.*.so" ) + + m.addPackage( "${PN}-shell", "Python shell-like functionality", "${PN}-core ${PN}-re", + "cmd.* commands.* dircache.* fnmatch.* glob.* popen2.* shlex.* shutil.*" ) + + m.addPackage( "${PN}-robotparser", "Python robots.txt parser", "${PN}-core ${PN}-netclient", + "urllib/robotparser.*") + + m.addPackage( "${PN}-subprocess", "Python subprocess support", "${PN}-core ${PN}-io ${PN}-re ${PN}-fcntl ${PN}-pickle", + "subprocess.*" ) + + m.addPackage( "${PN}-sqlite3", "Python Sqlite3 database support", "${PN}-core ${PN}-datetime ${PN}-lang ${PN}-crypt ${PN}-io ${PN}-threading", + "lib-dynload/_sqlite3.*.so sqlite3/dbapi2.* sqlite3/__init__.* sqlite3/dump.*" ) + + m.addPackage( "${PN}-sqlite3-tests", "Python Sqlite3 database support tests", "${PN}-core ${PN}-sqlite3", + "sqlite3/test" ) + + m.addPackage( "${PN}-stringold", "Python string APIs [deprecated]", "${PN}-core ${PN}-re", + "lib-dynload/strop.*.so string.* stringold.*" ) + + m.addPackage( "${PN}-syslog", "Python syslog interface", "${PN}-core", + "lib-dynload/syslog.*.so" ) + + m.addPackage( "${PN}-terminal", "Python terminal controlling support", "${PN}-core ${PN}-io", + "pty.* tty.*" ) + + m.addPackage( "${PN}-tests", "Python tests", "${PN}-core", + "test" ) # package + + m.addPackage( "${PN}-threading", "Python threading & synchronization support", "${PN}-core ${PN}-lang", + "_threading_local.* dummy_thread.* dummy_threading.* mutex.* threading.* Queue.*" ) + + m.addPackage( "${PN}-tkinter", "Python Tcl/Tk bindings", "${PN}-core", + "lib-dynload/_tkinter.*.so lib-tk tkinter" ) # package + + m.addPackage( "${PN}-unittest", "Python unit testing framework", "${PN}-core ${PN}-stringold ${PN}-lang ${PN}-io ${PN}-difflib ${PN}-pprint ${PN}-shell", + "unittest/" ) + + m.addPackage( "${PN}-unixadmin", "Python Unix administration support", "${PN}-core", + "lib-dynload/nis.*.so lib-dynload/grp.*.so lib-dynload/pwd.*.so getpass.*" ) + + m.addPackage( "${PN}-xml", "Python basic XML support", "${PN}-core ${PN}-elementtree ${PN}-re", + "lib-dynload/pyexpat.*.so xml xmllib.*" ) # package + + m.addPackage( "${PN}-xmlrpc", "Python XML-RPC support", "${PN}-core ${PN}-xml ${PN}-netserver ${PN}-lang", + "xmlrpclib.* SimpleXMLRPCServer.* DocXMLRPCServer.* xmlrpc" ) + + m.addPackage( "${PN}-mailbox", "Python mailbox format support", "${PN}-core ${PN}-mime", + "mailbox.*" ) + + m.make() diff --git a/scripts/contrib/test_build_time.sh b/scripts/contrib/test_build_time.sh new file mode 100755 index 0000000000..9e5725ae54 --- /dev/null +++ b/scripts/contrib/test_build_time.sh @@ -0,0 +1,237 @@ +#!/bin/bash + +# Build performance regression test script +# +# Copyright 2011 Intel Corporation +# All rights reserved. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# +# DESCRIPTION +# This script is intended to be used in conjunction with "git bisect run" +# in order to find regressions in build time, however it can also be used +# independently. It cleans out the build output directories, runs a +# specified worker script (an example is test_build_time_worker.sh) under +# TIME(1), logs the results to TEST_LOGDIR (default /tmp) and returns a +# value telling "git bisect run" whether the build time is good (under +# the specified threshold) or bad (over it). There is also a tolerance +# option but it is not particularly useful as it only subtracts the +# tolerance from the given threshold and uses it as the actual threshold. +# +# It is also capable of taking a file listing git revision hashes to be +# test-applied to the repository in order to get past build failures that +# would otherwise cause certain revisions to have to be skipped; if a +# revision does not apply cleanly then the script assumes it does not +# need to be applied and ignores it. +# +# Please see the help output (syntax below) for some important setup +# instructions. +# +# AUTHORS +# Paul Eggleton + + +syntax() { + echo "syntax: $0