From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id F1264138346 for ; Tue, 7 Jan 2020 20:15:00 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 23880E085D; Tue, 7 Jan 2020 20:15:00 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 09DF2E085D for ; Tue, 7 Jan 2020 20:14:59 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0DEE234DE7D for ; Tue, 7 Jan 2020 20:14:59 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id BA9CE79 for ; Tue, 7 Jan 2020 20:14:57 +0000 (UTC) From: "Thomas Deutschmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Thomas Deutschmann" Message-ID: <1578427794.9cca61dcffd3969ce31898541a50bafedc4dd6d9.whissi@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: / X-VCS-Repository: proj/genkernel X-VCS-Files: gen_compile.sh genkernel X-VCS-Directories: / X-VCS-Committer: whissi X-VCS-Committer-Name: Thomas Deutschmann X-VCS-Revision: 9cca61dcffd3969ce31898541a50bafedc4dd6d9 X-VCS-Branch: master Date: Tue, 7 Jan 2020 20:14:57 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 5ba6845b-9f46-4a4a-a037-da9d4ab7a2ff X-Archives-Hash: 2e6ae01f371577c52276bee1aa5d3db6 commit: 9cca61dcffd3969ce31898541a50bafedc4dd6d9 Author: Thomas Deutschmann gentoo org> AuthorDate: Tue Jan 7 20:06:19 2020 +0000 Commit: Thomas Deutschmann gentoo org> CommitDate: Tue Jan 7 20:09:54 2020 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=9cca61dc gen_compile.sh: compile_modules(): Add parameter "copy_kernel" When building kernel with integrated initramfs we don't want to copy kernel to its final location before we integrated initramfs or otherwise, the second call to compile_modules() would preserve previous incomplete image. Signed-off-by: Thomas Deutschmann gentoo.org> gen_compile.sh | 19 +++++++++++++++++++ genkernel | 9 +++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/gen_compile.sh b/gen_compile.sh index 9c6b6f0..4942a0c 100755 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -254,7 +254,20 @@ compile_modules() { fi } +# @FUNCTION: compile_kernel +# @USAGE: +# @DESCRIPTION: +# Will compile and optionally copy compiled kernel and System.map +# to its final location. +# +# Boolean which indicates if kernel and System.map should +# get copied to its final location compile_kernel() { + [[ ${#} -ne 1 ]] \ + && gen_die "$(get_useful_function_stack "${FUNCNAME}")Invalid usage of ${FUNCNAME}(): Function takes exactly one argument (${#} given)!" + + local copy_kernel="${1}" + [ -z "${KERNEL_MAKE}" ] \ && gen_die "KERNEL_MAKE undefined - I don't know how to compile a kernel for this arch!" @@ -295,6 +308,12 @@ compile_kernel() { print_info 1 "$(get_indent 1)>> Skipping installation of bundled firmware due to --no-firmware-install ..." fi + if ! isTrue "${copy_kernel}" + then + print_info 5 "Not copying compiled kernel yet (${FUNCNAME} called with copy_kernel=no) ..." + return + fi + local tmp_kernel_binary=$(find_kernel_binary ${KERNEL_BINARY_OVERRIDE:-${KERNEL_BINARY}}) local tmp_kernel_binary2=$(find_kernel_binary ${KERNEL_BINARY_2}) if [ -z "${tmp_kernel_binary}" ] diff --git a/genkernel b/genkernel index 8435350..127844a 100755 --- a/genkernel +++ b/genkernel @@ -250,7 +250,12 @@ then print_info 2 "$(get_indent 1)>> Kernel version has not changed since genkernel start" fi - compile_kernel + if isTrue "${INTEGRATED_INITRAMFS}" + then + compile_kernel no + else + compile_kernel yes + fi # Compile modules if isTrue "${BUILD_MODULES}" && ! isTrue "${BUILD_STATIC}" @@ -372,7 +377,7 @@ then unset cfg_CONFIG_INITRAMFS_SOURCE # We build the kernel a second time to include the initramfs - compile_kernel + compile_kernel yes fi if [ -n "${KERNCACHE}" ]