From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6755821036247187456 X-Received: by 2002:a63:1c24:: with SMTP id c36mr35995311pgc.292.1572962166702; Tue, 05 Nov 2019 05:56:06 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:90a:322b:: with SMTP id k40ls884632pjb.3.canary-gmail; Tue, 05 Nov 2019 05:56:06 -0800 (PST) X-Google-Smtp-Source: APXvYqyKgZWVVXMnfCJj30NUdcY7+HM7wKW5oS6KrONW55puHjv3hbsDC3rDIDPUv5KujuS40/Gr X-Received: by 2002:a17:90a:31cf:: with SMTP id j15mr7091288pjf.130.1572962166135; Tue, 05 Nov 2019 05:56:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572962166; cv=none; d=google.com; s=arc-20160816; b=tuzsXL5r0JlXd3v22eg9UNxe1RJwABF44owkRkKYnTH7CCj13L/SFxeuQrzy+Pe3z7 eQRLJxUy33Zv/idptJbnRPRd6QWqN9qBp2PrJmSgyK48+oMBH73UlFIlewhxL6ukbUzq BJfwVj5uXaiuE8EiU/eyCX11ODUZutYEmGrfTxoFC2/fvlTGvSJAOFBr8TCEjNxZYGRt eN4IIzNtqLNn9Xb3Uboe6b6xYNF1HI71SRUlFzJj2f4DbDGF/M41IYrew9zVgc/xLj8k ipTNADZUoTp+u6vjgJOad2+GsrIepZKGmlJoVG35ufhS3DcdYqpXAHOa2Ug4POb5cUXg lBlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:ironport-sdr:ironport-sdr; bh=lW6dQt0f2F39du7/212chvgFoIo79OQxQ43FSI2Z39E=; b=DCeSjR5QFEAAH+aNoYytMhczRenJhFC5QPukgg9pFrwYQioaIeeWR+ZjarqR6qVMld 0rPX7I7rrLwh3H/Z+S2R6jwV1amrGQuj3LIlbrFt9JRl/AT4IzEtfdIKs7VffsTrUayN EUIPhDoy321lGkULSHQv677q5dYYfS7fThh2KvXguNoEVxhDBY/yrPUx6jtI2C8UA9tp Ved8jNsU6LzxR+JcLgt3ipfsjnjlCzs5OWPE0WL9rT00OUUxJjSB8S8M55DeNrrChqdu u8BQzzL1+qG9x7/EgPyu6ECzVdV3RXB21/QXRugUEUNQGio+MAr97+M85r0FVXdYMf8K JP+Q== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of cedric_hombourger@mentor.com designates 68.232.129.153 as permitted sender) smtp.mailfrom=Cedric_Hombourger@mentor.com Return-Path: Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com. [68.232.129.153]) by gmr-mx.google.com with ESMTPS id w63si40618pgd.2.2019.11.05.05.56.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Nov 2019 05:56:06 -0800 (PST) Received-SPF: pass (google.com: domain of cedric_hombourger@mentor.com designates 68.232.129.153 as permitted sender) client-ip=68.232.129.153; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of cedric_hombourger@mentor.com designates 68.232.129.153 as permitted sender) smtp.mailfrom=Cedric_Hombourger@mentor.com IronPort-SDR: 8PSiq0lKKFzL0oJZUW/3Kfl5WG6LYBdlN1+cUw3NICPWLkagWzmsE0yU7XthzhdQCBpFrt7UOU fYiHvJHgs3XBRnC6Pv16A+L+OAexlizA87sFG+2tA2Dqj3g/Yqcu4dgxYP80rrt8E3b1p2dwiV LXUw5RXhgvPmi9U9foNc4a9MaHGE8ROF9zOPUqbgafgZvmWhVmt9Myu1uK7sykK4smj0J3tJNW /EFDiXnKWu+eSFvvo5JCJ4BDohOLa1YPWMxIhbB2u/6pdgYagNRT46LpoYg9FdpCG7+jHVOMob PmE= X-IronPort-AV: E=Sophos;i="5.68,271,1569312000"; d="scan'208";a="44728238" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 05 Nov 2019 05:56:04 -0800 IronPort-SDR: qzpW2aT/Q08sroMDg1Wm2wcUPFMkeabmyeEWT1os+5x9+iPq/pa423KYFgIr3Fl1g76fvk6eBm br9d2oroC23TKKawsTY7zDsPhcXjWjlU2n55uT4iKB2bOxy9IVmCSUaJeKAKJ9xIFpuHd3z9dd 6EjTnNQmXa/Lgmm06Km97r64aXM7x2QFSDIaV/gnTM7e8OGp/G0bwFB4J+eTM0jhR54zPLfpMq E2VP5ktbun3QWMP/ovo5gZWbK4OKFvRUfWo8vfLTWz8olpUIUZFFL6NuSJr4YaktQJzPbHeVyU 6Uk= From: Cedric Hombourger To: CC: Cedric Hombourger Subject: [PATCH 1/7] recipes-kernel/linux: make KERNEL_DEFCONFIG support in-tree defconfigs Date: Tue, 5 Nov 2019 14:55:39 +0100 Message-ID: <1572962145-318-2-git-send-email-Cedric_Hombourger@mentor.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1572962145-318-1-git-send-email-Cedric_Hombourger@mentor.com> References: <1572962145-318-1-git-send-email-Cedric_Hombourger@mentor.com> MIME-Version: 1.0 Content-Type: text/plain Return-Path: Cedric_Hombourger@mentor.com X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-06.mgc.mentorg.com (139.181.222.6) To svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) X-TUID: RfhuQO1I8C9w The recipe expected the specified KERNEL_DEFCONFIG to be provided as a SRC_URI while the kernel already provides many useful defconfigs. The recipe will now check if the specified configuration can be found in WORKDIR. If it is found, it will then be used via "make olddefconfig" as before. It will otherwise assume that it is an in-tree defconfig and attempt a "make foobar_defconfig" (where foobar_defconfig is the user-provided KERNEL_DEFCONFIG setting). To support this change, a KERNEL_CONFIG_TARGET variable is passed to the build-kernel.sh script via the environment. Signed-off-by: Cedric Hombourger --- meta/recipes-kernel/linux/files/build-kernel.sh | 6 +----- meta/recipes-kernel/linux/linux-custom.inc | 9 ++++++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/meta/recipes-kernel/linux/files/build-kernel.sh b/meta/recipes-kernel/linux/files/build-kernel.sh index b46cefa..386e58b 100644 --- a/meta/recipes-kernel/linux/files/build-kernel.sh +++ b/meta/recipes-kernel/linux/files/build-kernel.sh @@ -36,11 +36,7 @@ REPACK_DIR="$1/../repack" REPACK_LINUX_IMAGE_DIR="${REPACK_DIR}/linux-image" REPACK_LINUX_HEADERS_DIR="${REPACK_DIR}/linux-headers" -if [ -e .config ]; then - make olddefconfig -else - make defconfig -fi +make ${KERNEL_CONFIG_TARGET} || exit ${?} KV=$( make -s kernelrelease ) if [ "${KV}" != "${PV}" ]; then diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc index b597e25..0c185d8 100644 --- a/meta/recipes-kernel/linux/linux-custom.inc +++ b/meta/recipes-kernel/linux/linux-custom.inc @@ -61,8 +61,14 @@ addtask devshell after do_install_builddeps dpkg_runbuild() { chmod +x ${WORKDIR}/build-kernel.sh + KERNEL_CONFIG_TARGET="${KERNEL_DEFCONFIG}" if [ -n "${KERNEL_DEFCONFIG}" ]; then - cp ${WORKDIR}/${KERNEL_DEFCONFIG} ${S}/.config + if [ -e "${WORKDIR}/${KERNEL_DEFCONFIG}" ]; then + cp ${WORKDIR}/${KERNEL_DEFCONFIG} ${S}/.config + KERNEL_CONFIG_TARGET="olddefconfig" + fi + else + KERNEL_CONFIG_TARGET="defconfig" fi E="${@ bb.utils.export_proxies(d)}" @@ -71,6 +77,7 @@ dpkg_runbuild() { export KERNEL_NAME=${KERNEL_NAME_PROVIDED} export KBUILD_DEPENDS="${KBUILD_DEPENDS}" + export KERNEL_CONFIG_TARGET export KERNEL_DEBIAN_DEPENDS="${KERNEL_DEBIAN_DEPENDS}" export KERNEL_FILE="${KERNEL_FILE}" export KERNEL_HEADERS_DEBIAN_DEPENDS="${KERNEL_HEADERS_DEBIAN_DEPENDS}" -- 2.20.1