# IceCream distributed compiling support # # Stages directories with symlinks from gcc/g++ to icecc, for both # native and cross compilers. Depending on each configure or compile, # the directories are added at the head of the PATH list and ICECC_CXX # and ICEC_CC are set. # # For the cross compiler, creates a tar.gz of our toolchain and sets # ICECC_VERSION accordingly. # #The class now handles all 3 different compile 'stages' (i.e native ,cross-kernel and target) creating the #necessary enviroment tar.gz file to be used by the remote machines. #It also supports meta-toolchain generation # #If ICECC_PATH is not set in local.conf then the class will try to locate it using 'which' #but nothing is sure ;) # #If ICECC_ENV_EXEC is set in local.conf should point to the icecc-create-env script provided by the user #or the default one provided by icecc-create-env.bb will be used #(NOTE that this is a modified version of the script need it and *not the one that comes with icecc* # #User can specify if specific packages or packages belonging to class should not use icecc to distribute #compile jobs to remote machines, but handled localy, by defining ICECC_USER_CLASS_BL and ICECC_PACKAGE_BL #with the appropriate values in local.conf ######################################################################################### #Error checking is kept to minimum so double check any parameters you pass to the class ########################################################################################### def icc_determine_gcc_version(gcc): """ Hack to determine the version of GCC 'i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5363)' """ import os return os.popen("%s --version" % gcc ).readline().split()[2] def create_cross_env(bb,d): """ Create a tar.bz2 of the current toolchain """ # Constin native-native compilation no environment needed if # host prefix is empty (let us duplicate the query for ease) prefix = bb.data.expand('${HOST_PREFIX}', d) if len(prefix) == 0: return "" import tarfile, socket, time, os ice_dir = bb.data.expand('${CROSS_DIR}', d) prefix = bb.data.expand('${HOST_PREFIX}' , d) distro = bb.data.expand('${DISTRO}', d) target_sys = bb.data.expand('${TARGET_SYS}', d) target_prefix = bb.data.expand('${TARGET_PREFIX}', d) float = bb.data.getVar('TARGET_FPU', d) or "hard" name = socket.gethostname() # Stupid check to determine if we have built a libc and a cross # compiler. try: os.stat(os.path.join(ice_dir, target_sys, 'lib', 'libstdc++.so')) os.stat(os.path.join(ice_dir, target_sys, 'bin', 'g++')) except: # no cross compiler built yet bb.error('no cross compiler built yet?') return "" VERSION = icc_determine_gcc_version( os.path.join(ice_dir,target_sys,"bin","g++") ) cross_name = prefix + distro + "-" + target_sys + "-" + float + "-" + VERSION + "-" + name tar_file = os.path.join(ice_dir, 'ice', cross_name + '.tar.gz') try: os.stat(tar_file) # tar file already exists return tar_file except: try: os.makedirs(os.path.join(ice_dir,'ice')) except: # directory already exists, continue pass #check if user has specified a specific icecc-create-env script #if not use the OE provided one cr_env_script = bb.data.getVar('ICECC_ENV_EXEC', d) or bb.data.expand('${STAGING_DIR}', d)+"/ice/icecc-create-env" #call the modified create-env script result=os.popen("%s %s %s %s %s %s" %(cr_env_script, "--silent", os.path.join(ice_dir,target_sys,'bin','gcc'), os.path.join(ice_dir,target_sys,'bin','g++'), os.path.join(ice_dir,target_sys,'bin','as'), os.path.join(ice_dir,"ice",cross_name) ) ) return tar_file def create_native_env(bb,d): import tarfile, socket, time, os ice_dir = bb.data.expand('${CROSS_DIR}', d) prefix = bb.data.expand('${HOST_PREFIX}' , d) distro = bb.data.expand('${DISTRO}', d) target_sys = bb.data.expand('${TARGET_SYS}', d) target_prefix = bb.data.expand('${TARGET_PREFIX}', d) float = bb.data.getVar('TARGET_FPU', d) or "hard" name = socket.gethostname() archive_name = "local-host-env" + "-" + name tar_file = os.path.join(ice_dir, 'ice', archive_name + '.tar.gz') try: os.stat(tar_file) # tar file already exists return tar_file except: try: #os.makedirs(os.path.join(ice_dir)) os.makedirs(os.path.join(ice_dir,'ice')) except: # directory already exists, continue pass #check if user has specified a specific icecc-create-env script #if not use the OE provided one cr_env_script = bb.data.getVar('ICECC_ENV_EXEC', d) or bb.data.expand('${STAGING_DIR}', d)+"/ice/icecc-create-env" result=os.popen("%s %s %s %s %s %s" %(cr_env_script, "--silent", os.popen("%s gcc" % "which").read()[:-1], os.popen("%s g++" % "which").read()[:-1], os.popen("%s as" % "which").read()[:-1], os.path.join(ice_dir,"ice",archive_name) ) ) return tar_file def get_cross_kernel_cc(bb,d): kernel_cc = bb.data.expand('${KERNEL_CC}', d) kernel_cc = kernel_cc.replace('ccache', '') kernel_cc = kernel_cc.strip() return kernel_cc def create_cross_kernel_env(bb,d): import tarfile, socket, time, os ice_dir = bb.data.expand('${CROSS_DIR}', d) prefix = bb.data.expand('${HOST_PREFIX}' , d) distro = bb.data.expand('${DISTRO}', d) target_sys = bb.data.expand('${TARGET_SYS}', d) target_prefix = bb.data.expand('${TARGET_PREFIX}', d) float = bb.data.getVar('TARGET_FPU', d) or "hard" name = socket.gethostname() kernel_cc = get_cross_kernel_cc(bb, d) # Stupid check to determine if we have built a libc and a cross # compiler. try: os.stat(os.path.join(ice_dir, 'bin', kernel_cc)) except: # no cross compiler built yet bb.error('no kernel cross compiler built yet') return "" VERSION = icc_determine_gcc_version( os.path.join(ice_dir,"bin",kernel_cc) ) cross_name = prefix + distro + "-" + target_sys + "-" + float + "-" + VERSION + "-" + name tar_file = os.path.join(ice_dir, 'ice', cross_name + '.tar.gz') try: os.stat(tar_file) # tar file already exists return tar_file except: try: os.makedirs(os.path.join(ice_dir,'ice')) except: # directory already exists, continue pass #check if user has specified a specific icecc-create-env script #if not use the OE provided one cr_env_script = bb.data.getVar('ICECC_ENV_EXEC', d) or bb.data.expand('${STAGING_DIR}', d)+"/ice/icecc-create-env" result=os.popen("%s %s %s %s %s %s" %(cr_env_script, "--silent", os.path.join(ice_dir,'bin',kernel_cc), os.path.join(ice_dir,target_sys,'bin','g++'), os.path.join(ice_dir,target_sys,'bin','as'), os.path.join(ice_dir,"ice",cross_name) ) ) return tar_file def create_env(bb,d): #return create_cross_kernel_env(bb,d) if bb.data.inherits_class("native", d): return create_native_env(bb,d) elif bb.data.inherits_class("kernel", d): return create_cross_kernel_env(bb,d) elif bb.data.inherits_class("cross", d): return create_native_env(bb,d) elif bb.data.inherits_class("sdk", d): return create_native_env(bb,d) else: return create_cross_env(bb,d) def create_path(compilers, type, bb, d): """ Create Symlinks for the icecc in the staging directory """ import os staging = os.path.join(bb.data.expand('${STAGING_DIR}', d), "ice", type) #check if the icecc path is set by the user icecc = bb.data.getVar('ICECC_PATH', d) or os.popen("%s icecc" % "which").read()[:-1] # Create the dir if necessary try: os.stat(staging) except: os.makedirs(staging) for compiler in compilers: gcc_path = os.path.join(staging, compiler) try: os.stat(gcc_path) except: os.symlink(icecc, gcc_path) return staging + ":" def use_icc_version(bb,d): icecc_ver = "yes" system_class_blacklist = [ "none" ] for black in system_class_blacklist: if bb.data.inherits_class(black, d): icecc_ver = "no" user_class_blacklist = bb.data.getVar('ICECC_USER_CLASS_BL', d) or "none" user_class_blacklist = user_class_blacklist.split() for black in user_class_blacklist: if bb.data.inherits_class(black, d): icecc_ver = "no" return icecc_ver def icc_path(bb,d): package_tmp = bb.data.expand('${PN}', d) #"system" package blacklist contains a list of packages that can not distribute compile tasks #for one reason or the other system_package_blacklist = [ "uclibc", "glibc", "gcc", "qemu", "bind", "u-boot", "dhcp-forwarder", "enchant" ] user_package_blacklist = (bb.data.getVar('ICECC_USER_PACKAGE_BL', d) or "").split() package_blacklist = system_package_blacklist + user_package_blacklist for black in package_blacklist: if black in package_tmp: bb.note(package_tmp, ' found in blacklist, disable icecc') bb.data.setVar("PARALLEL_MAKE" , "", d) return "" prefix = bb.data.expand('${HOST_PREFIX}', d) if bb.data.inherits_class("cross", d): return create_path( ["gcc", "g++"], "native", bb, d) elif bb.data.inherits_class("native", d): return create_path( ["gcc", "g++"], "native", bb, d) elif bb.data.inherits_class("kernel", d): return create_path( [get_cross_kernel_cc(bb,d), ], "cross-kernel", bb, d) elif len(prefix) == 0: return create_path( ["gcc", "g++"], "native", bb, d) else: return create_path( [prefix+"gcc", prefix+"g++"], "cross", bb, d) def icc_version(bb,d): return create_env(bb,d) def check_for_kernel(bb,d): if bb.data.inherits_class("kernel", d): return "yes" return "no" set_icecc_env() { ICECC_PATH=${@icc_path(bb,d)} if test x${ICECC_PATH} != x; then export PATH=${ICECC_PATH}$PATH export CCACHE_PATH=$PATH #check if we are building a kernel and select gcc-cross-kernel if [ "${@check_for_kernel(bb,d)}" = "yes" ]; then export ICECC_CC="${@get_cross_kernel_cc(bb,d)}" export ICECC_CXX="${HOST_PREFIX}g++" else export ICECC_CC="${HOST_PREFIX}gcc" export ICECC_CXX="${HOST_PREFIX}g++" fi if [ "${@use_icc_version(bb,d)}" = "yes" ]; then export ICECC_VERSION="${@icc_version(bb,d)}" else export -n ICECC_VERSION fi oenote "set the icecream environment variables: PATH=$PATH, CCACHE_PATH=$CCACHE_PATH, ICECC_CC=$ICECC_CC, ICECC_CXX=$ICECC_CXX, ICECC_VERSION=$ICECC_VERSION" fi } do_configure_prepend() { set_icecc_env } do_compile_prepend() { set_icecc_env } /tr> -rw-r--r--meta-selftest/recipes-test/devtool/devtool-test-localonly/file21
-rw-r--r--meta-selftest/recipes-test/devtool/devtool-test-patch-gz.bb17
-rw-r--r--meta-selftest/recipes-test/devtool/devtool-test-patch-gz/readme.patch.gzbin0 -> 449 bytes-rw-r--r--meta-selftest/recipes-test/devtool/devtool-test-subdir.bb9
-rw-r--r--meta-selftest/recipes-test/devtool/devtool-test-subdir/devtool-test-subdir.tar.gzbin0 -> 181 bytes-rw-r--r--meta-selftest/recipes-test/devtool/devtool-test-subdir/testfile1
-rw-r--r--meta-selftest/recipes-test/devtool/devtool-upgrade-test1-1.5.3/0001-Add-a-note-line-to-the-quick-reference.patch25
-rw-r--r--meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb18
-rw-r--r--meta-selftest/recipes-test/devtool/devtool-upgrade-test1_1.5.3.bb.upgraded16
-rw-r--r--meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb20
-rw-r--r--meta-selftest/recipes-test/devtool/devtool-upgrade-test2_git.bb.upgraded19
-rw-r--r--meta-selftest/recipes-test/emptytest/emptytest.bb2
-rw-r--r--meta-selftest/recipes-test/error/error.bb10
-rw-r--r--meta-selftest/recipes-test/images/error-image.bb8
-rw-r--r--meta-selftest/recipes-test/images/oe-selftest-image.bb2
-rw-r--r--meta-selftest/recipes-test/images/test-empty-image.bb6
-rw-r--r--meta-selftest/recipes-test/images/wic-image-minimal.bb15
-rw-r--r--meta-selftest/recipes-test/images/wic-image-minimal.wks9
-rw-r--r--meta-selftest/recipes-test/m4/m4_%.bbappend (renamed from meta-selftest/recipes-test/m4/m4_1.4.17.bbappend)0
-rw-r--r--meta-selftest/recipes-test/postinst/postinst_1.0.bb126
-rw-r--r--meta-selftest/recipes-test/recipetool/selftest-recipetool-appendfile.bb2
-rw-r--r--meta-selftest/recipes-test/selftest-ed/selftest-ed_0.5.bb22
-rw-r--r--meta-selftest/recipes-test/selftest-ed/selftest-ed_1.14.1.bb35
-rw-r--r--meta-selftest/recipes-test/xcursor-transparent-theme/xcursor-transparent-theme_%.bbappend (renamed from meta-selftest/recipes-test/xcursor-transparent-theme/xcursor-transparent-theme_0.1.1.bbappend)0
-rw-r--r--meta-selftest/wic/test_rawcopy_plugin.wks.in6
-rw-r--r--meta-selftest/wic/wictestdisk.wks7
-rw-r--r--meta-skeleton/recipes-kernel/hello-mod/hello-mod_0.1.bb3
-rw-r--r--meta-skeleton/recipes-kernel/linux/linux-yocto-custom.bb15
-rw-r--r--meta-skeleton/recipes-kernel/linux/linux-yocto-custom/0001-linux-version-tweak.patch21
-rw-r--r--meta-skeleton/recipes-skeleton/service/service_0.1.bb9
-rw-r--r--meta-skeleton/recipes-skeleton/useradd/useradd-example.bb5
-rw-r--r--meta/classes/allarch.bbclass24
-rw-r--r--meta/classes/archiver.bbclass275
-rw-r--r--meta/classes/autotools.bbclass201
-rw-r--r--meta/classes/autotools_stage.bbclass2
-rw-r--r--meta/classes/base.bbclass391
-rw-r--r--meta/classes/bash-completion.bbclass7
-rw-r--r--meta/classes/binconfig-disabled.bbclass4
-rw-r--r--meta/classes/binconfig.bbclass8
-rw-r--r--meta/classes/blacklist.bbclass27
-rw-r--r--meta/classes/boot-directdisk.bbclass192
-rw-r--r--meta/classes/bootimg.bbclass294
-rw-r--r--meta/classes/bugzilla.bbclass28
-rw-r--r--meta/classes/buildhistory.bbclass400
-rw-r--r--meta/classes/buildstats-summary.bbclass11
-rw-r--r--meta/classes/buildstats.bbclass281
-rw-r--r--meta/classes/ccache.bbclass15
-rw-r--r--meta/classes/chrpath.bbclass36
-rw-r--r--meta/classes/cmake.bbclass63
-rw-r--r--meta/classes/cml1.bbclass8
-rw-r--r--meta/classes/compress_doc.bbclass38
-rw-r--r--meta/classes/copyleft_compliance.bbclass10
-rw-r--r--meta/classes/copyleft_filter.bbclass12
-rw-r--r--meta/classes/core-image.bbclass17
-rw-r--r--meta/classes/cpan-base.bbclass19
-rw-r--r--meta/classes/cpan.bbclass2
-rw-r--r--meta/classes/cpan_build.bbclass23
-rw-r--r--meta/classes/cross-canadian.bbclass123
-rw-r--r--meta/classes/cross.bbclass35
-rw-r--r--meta/classes/crosssdk.bbclass14
-rw-r--r--meta/classes/cve-check.bbclass269
-rw-r--r--meta/classes/debian.bbclass24
-rw-r--r--meta/classes/deploy.bbclass1
-rw-r--r--meta/classes/devshell.bbclass11
-rw-r--r--meta/classes/devupstream.bbclass48
-rw-r--r--meta/classes/distro_features_check.bbclass8
-rw-r--r--meta/classes/distrodata.bbclass197
-rw-r--r--meta/classes/distutils-base.bbclass2
-rw-r--r--meta/classes/distutils-common-base.bbclass11
-rw-r--r--meta/classes/distutils-native-base.bbclass3
-rw-r--r--meta/classes/distutils-tools.bbclass14
-rw-r--r--meta/classes/distutils.bbclass26
-rw-r--r--meta/classes/distutils3-base.bbclass5
-rw-r--r--meta/classes/distutils3-native-base.bbclass4
-rw-r--r--meta/classes/distutils3.bbclass42
-rw-r--r--meta/classes/externalsrc.bbclass177
-rw-r--r--meta/classes/extrausers.bbclass18
-rw-r--r--meta/classes/fontcache.bbclass35
-rw-r--r--meta/classes/fs-uuid.bbclass24
-rw-r--r--meta/classes/gconf.bbclass15
-rw-r--r--meta/classes/gettext.bbclass8
-rw-r--r--meta/classes/gio-module-cache.bbclass37
-rw-r--r--meta/classes/gnome.bbclass4
-rw-r--r--meta/classes/gnomebase.bbclass5
-rw-r--r--meta/classes/go.bbclass77
-rw-r--r--meta/classes/goarch.bbclass50
-rw-r--r--meta/classes/gobject-introspection-data.bbclass7
-rw-r--r--meta/classes/gobject-introspection.bbclass43
-rw-r--r--meta/classes/grub-efi.bbclass63
-rw-r--r--meta/classes/gsettings.bbclass13
-rw-r--r--meta/classes/gtk-doc.bbclass72
-rw-r--r--meta/classes/gtk-icon-cache.bbclass30
-rw-r--r--meta/classes/gtk-immodules-cache.bbclass64
-rw-r--r--meta/classes/gummiboot.bbclass114
-rw-r--r--meta/classes/gzipnative.bbclass5
-rw-r--r--meta/classes/icecc.bbclass74
-rw-r--r--meta/classes/image-buildinfo.bbclass52
-rw-r--r--meta/classes/image-container.bbclass21
-rw-r--r--meta/classes/image-live.bbclass286
-rw-r--r--meta/classes/image-mklibs.bbclass39
-rw-r--r--meta/classes/image-prelink.bbclass27
-rw-r--r--meta/classes/image-swab.bbclass94
-rw-r--r--meta/classes/image-vm.bbclass177
-rw-r--r--meta/classes/image.bbclass663
-rw-r--r--meta/classes/image_types.bbclass262
-rw-r--r--meta/classes/image_types_uboot.bbclass31
-rw-r--r--meta/classes/image_types_wic.bbclass117
-rw-r--r--meta/classes/insane.bbclass734
-rw-r--r--meta/classes/kernel-arch.bbclass16
-rw-r--r--meta/classes/kernel-fitimage.bbclass441
-rw-r--r--meta/classes/kernel-grub.bbclass44
-rw-r--r--meta/classes/kernel-module-split.bbclass130
-rw-r--r--meta/classes/kernel-uboot.bbclass3
-rw-r--r--meta/classes/kernel-uimage.bbclass27
-rw-r--r--meta/classes/kernel-yocto.bbclass270
-rw-r--r--meta/classes/kernel.bbclass365
-rw-r--r--meta/classes/kernelsrc.bbclass6
-rw-r--r--meta/cla