# Copyright (C) 2014 Linaro # Copyright (C) 2012, 2013 O.S. Systems Software LTDA. # Released under the MIT license (see COPYING.MIT for the terms) DESCRIPTION = "Linux kernel for MSM platforms" LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" inherit kernel # Put a local version until we have a true SRCREV to point to LOCALVERSION ?= "+linaro" SCMVERSION ?= "y" LINUX_LINARO_QCOM_GIT ?= "git://git.linaro.org/landing-teams/working/qualcomm/kernel.git;protocol=https" SRC_URI = "${LINUX_LINARO_QCOM_GIT};branch=${SRCBRANCH}" S = "${WORKDIR}/git" KERNEL_DEFCONFIG_aarch64 ?= "${S}/arch/arm64/configs/defconfig" KERNEL_DEFCONFIG_apq8064 ?= "${S}/arch/arm/configs/qcom_defconfig" KERNEL_CONFIG_FRAGMENTS += "${S}/kernel/configs/distro.config" kernel_conf_variable() { CONF_SED_SCRIPT="$CONF_SED_SCRIPT /CONFIG_$1[ =]/d;" if test "$2" = "n" then echo "# CONFIG_$1 is not set" >> ${B}/.config else echo "CONFIG_$1=$2" >> ${B}/.config fi } do_configure_prepend() { echo "" > ${B}/.config CONF_SED_SCRIPT="" kernel_conf_variable LOCALVERSION "\"${LOCALVERSION}\"" kernel_conf_variable LOCALVERSION_AUTO y if [ -f '${WORKDIR}/defconfig' ]; then sed -e "${CONF_SED_SCRIPT}" < '${WORKDIR}/defconfig' >> '${B}/.config' else sed -e "${CONF_SED_SCRIPT}" < '${KERNEL_DEFCONFIG}' >> '${B}/.config' fi if [ "${SCMVERSION}" = "y" ]; then # Add GIT revision to the local version head=`git --git-dir=${S}/.git rev-parse --verify --short HEAD 2> /dev/null` printf "%s%s" +g $head > ${B}/.scmversion fi # Check for kernel config fragments. The assumption is that the config # fragment will be specified with the absolute path. For example: # * ${WORKDIR}/config1.cfg # * ${S}/config2.cfg # Iterate through the list of configs and make sure that you can find # each one. If not then error out. # NOTE: If you want to override a configuration that is kept in the kernel # with one from the OE meta data then you should make sure that the # OE meta data version (i.e. ${WORKDIR}/config1.cfg) is listed # after the in kernel configuration fragment. # Check if any config fragments are specified. if [ ! -z "${KERNEL_CONFIG_FRAGMENTS}" ] then for f in ${KERNEL_CONFIG_FRAGMENTS} do # Check if the config fragment was copied into the WORKDIR from # the OE meta data if [ ! -e "$f" ] then echo "Could not find kernel config fragment $f" exit 1 fi done # Now that all the fragments are located merge them. ( cd ${WORKDIR} && ${S}/scripts/kconfig/merge_config.sh -m -r -O ${B} ${B}/.config ${KERNEL_CONFIG_FRAGMENTS} 1>&2 ) fi yes '' | oe_runmake -C ${S} O=${B} oldconfig oe_runmake -C ${S} O=${B} savedefconfig && cp ${B}/defconfig ${WORKDIR}/defconfig.saved } # append DTB do_compile_append() { if ! [ -e ${B}/arch/${ARCH}/boot/dts/${KERNEL_DEVICETREE} ] ; then oe_runmake ${KERNEL_DEVICETREE} fi cp arch/${ARCH}/boot/${KERNEL_IMAGETYPE} arch/${ARCH}/boot/${KERNEL_IMAGETYPE}.backup cat arch/${ARCH}/boot/${KERNEL_IMAGETYPE}.backup arch/${ARCH}/boot/dts/${KERNEL_DEVICETREE} > arch/${ARCH}/boot/${KERNEL_IMAGETYPE} rm -f arch/${ARCH}/boot/${KERNEL_IMAGETYPE}.backup }