diff options
Diffstat (limited to 'meta/classes-recipe/kernel-yocto.bbclass')
-rw-r--r-- | meta/classes-recipe/kernel-yocto.bbclass | 70 |
1 files changed, 47 insertions, 23 deletions
diff --git a/meta/classes-recipe/kernel-yocto.bbclass b/meta/classes-recipe/kernel-yocto.bbclass index 1a6695ba7e..6468e8aa90 100644 --- a/meta/classes-recipe/kernel-yocto.bbclass +++ b/meta/classes-recipe/kernel-yocto.bbclass @@ -63,7 +63,7 @@ def find_sccs(d): return sources_list # check the SRC_URI for "kmeta" type'd git repositories. Return the name of -# the repository as it will be found in WORKDIR +# the repository as it will be found in UNPACKDIR def find_kernel_feature_dirs(d): feature_dirs=[] fetch = bb.fetch2.Fetch([], d) @@ -147,24 +147,24 @@ do_kernel_metadata() { # from the source tree, into a common location and normalized "defconfig" name, # where the rest of the process will include and incoroporate it into the build # - # If the fetcher has already placed a defconfig in WORKDIR (from the SRC_URI), + # If the fetcher has already placed a defconfig in UNPACKDIR (from the SRC_URI), # we don't overwrite it, but instead warn the user that SRC_URI defconfigs take # precendence. # if [ -n "${KBUILD_DEFCONFIG}" ]; then if [ -f "${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG}" ]; then - if [ -f "${WORKDIR}/defconfig" ]; then + if [ -f "${UNPACKDIR}/defconfig" ]; then # If the two defconfig's are different, warn that we overwrote the - # one already placed in WORKDIR - cmp "${WORKDIR}/defconfig" "${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG}" + # one already placed in UNPACKDIR + cmp "${UNPACKDIR}/defconfig" "${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG}" if [ $? -ne 0 ]; then - bbdebug 1 "detected SRC_URI or unpatched defconfig in WORKDIR. ${KBUILD_DEFCONFIG} copied over it" + bbdebug 1 "detected SRC_URI or unpatched defconfig in UNPACKDIR. ${KBUILD_DEFCONFIG} copied over it" fi - cp -f ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${WORKDIR}/defconfig + cp -f ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${UNPACKDIR}/defconfig else - cp -f ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${WORKDIR}/defconfig + cp -f ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${UNPACKDIR}/defconfig fi - in_tree_defconfig="${WORKDIR}/defconfig" + in_tree_defconfig="${UNPACKDIR}/defconfig" else bbfatal "A KBUILD_DEFCONFIG '${KBUILD_DEFCONFIG}' was specified, but not present in the source tree (${S}/arch/${ARCH}/configs/)" fi @@ -176,12 +176,32 @@ do_kernel_metadata() { # kernel source tree, where they'll be used later. check_git_config patches="${@" ".join(find_patches(d,'kernel-meta'))}" - for p in $patches; do + if [ -n "$patches" ]; then ( - cd ${WORKDIR}/kernel-meta - git am -s $p - ) - done + cd ${UNPACKDIR}/kernel-meta + + # take the SRC_URI patches, and create a series file + # this is required to support some better processing + # of issues with the patches + rm -f series + for p in $patches; do + cp $p . + echo "$(basename $p)" >> series + done + + # process the series with kgit-s2q, which is what is + # handling the rest of the kernel. This allows us + # more flexibility for handling failures or advanced + # mergeing functinoality + message=$(kgit-s2q --gen -v --patches ${UNPACKDIR}/kernel-meta 2>&1) + if [ $? -ne 0 ]; then + # setup to try the patch again + kgit-s2q --prev + bberror "Problem applying patches to: ${UNPACKDIR}/kernel-meta" + bbfatal_log "\n($message)" + fi + ) + fi fi sccs_from_src_uri="${@" ".join(find_sccs(d))}" @@ -212,12 +232,12 @@ do_kernel_metadata() { # SRC_URI. If they were supplied, we convert them into include directives # for the update part of the process for f in ${feat_dirs}; do - if [ -d "${WORKDIR}/$f/meta" ]; then - includes="$includes -I${WORKDIR}/$f/kernel-meta" - elif [ -d "${WORKDIR}/../oe-local-files/$f" ]; then - includes="$includes -I${WORKDIR}/../oe-local-files/$f" - elif [ -d "${WORKDIR}/$f" ]; then - includes="$includes -I${WORKDIR}/$f" + if [ -d "${UNPACKDIR}/$f/kernel-meta" ]; then + includes="$includes -I${UNPACKDIR}/$f/kernel-meta" + elif [ -d "${UNPACKDIR}/../oe-local-files/$f" ]; then + includes="$includes -I${UNPACKDIR}/../oe-local-files/$f" + elif [ -d "${UNPACKDIR}/$f" ]; then + includes="$includes -I${UNPACKDIR}/$f" fi done for s in ${sccs} ${patches}; do @@ -408,7 +428,7 @@ do_kernel_checkout() { git init check_git_config git add . - git commit -q -m "baseline commit: creating repo for ${PN}-${PV}" + git commit -q -n -m "baseline commit: creating repo for ${PN}-${PV}" git clean -d -f fi @@ -440,7 +460,7 @@ do_kernel_configme() { config_flags="" ;; *) - if [ -f ${WORKDIR}/defconfig ]; then + if [ -f ${UNPACKDIR}/defconfig ]; then config_flags="-n" fi ;; @@ -455,7 +475,7 @@ do_kernel_configme() { bbfatal_log "Could not find configuration queue (${meta_dir}/config.queue)" fi - CFLAGS="${CFLAGS} ${TOOLCHAIN_OPTIONS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}" CC="${KERNEL_CC}" LD="${KERNEL_LD}" ARCH=${ARCH} merge_config.sh -O ${B} ${config_flags} ${configs} > ${meta_dir}/cfg/merge_config_build.log 2>&1 + CFLAGS="${CFLAGS} ${TOOLCHAIN_OPTIONS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCPP="${BUILD_CPP}" CC="${KERNEL_CC}" LD="${KERNEL_LD}" OBJCOPY="${KERNEL_OBJCOPY}" STRIP="${KERNEL_STRIP}" ARCH=${ARCH} merge_config.sh -O ${B} ${config_flags} ${configs} > ${meta_dir}/cfg/merge_config_build.log 2>&1 if [ $? -ne 0 -o ! -f ${B}/.config ]; then bberror "Could not generate a .config for ${KMACHINE}-${LINUX_KERNEL_TYPE}" if [ ${KCONF_AUDIT_LEVEL} -gt 1 ]; then @@ -489,6 +509,8 @@ python do_config_analysis() { env['PATH'] = "%s:%s%s" % (d.getVar('PATH'), s, "/scripts/util/") env['LD'] = d.getVar('KERNEL_LD') env['CC'] = d.getVar('KERNEL_CC') + env['OBJCOPY'] = d.getVar('KERNEL_OBJCOPY') + env['STRIP'] = d.getVar('KERNEL_STRIP') env['ARCH'] = d.getVar('ARCH') env['srctree'] = s @@ -550,6 +572,8 @@ python do_kernel_configcheck() { env['PATH'] = "%s:%s%s" % (d.getVar('PATH'), s, "/scripts/util/") env['LD'] = d.getVar('KERNEL_LD') env['CC'] = d.getVar('KERNEL_CC') + env['OBJCOPY'] = d.getVar('KERNEL_OBJCOPY') + env['STRIP'] = d.getVar('KERNEL_STRIP') env['ARCH'] = d.getVar('ARCH') env['srctree'] = s |