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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 1B3CA15800F for ; Sun, 8 Jan 2023 18:59:01 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 230F4E07D3; Sun, 8 Jan 2023 18:59:00 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id F3D65E07D3 for ; Sun, 8 Jan 2023 18:58:59 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BBE58340DAF for ; Sun, 8 Jan 2023 18:58:58 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 51FAA76B for ; Sun, 8 Jan 2023 18:58:57 +0000 (UTC) From: "Matt Turner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Turner" Message-ID: <1673204222.92427dc0d11b26b03fcfb9c6de7c23fac32c7888.mattst88@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: / X-VCS-Repository: proj/genkernel X-VCS-Files: gen_cmdline.sh gen_determineargs.sh genkernel.conf X-VCS-Directories: / X-VCS-Committer: mattst88 X-VCS-Committer-Name: Matt Turner X-VCS-Revision: 92427dc0d11b26b03fcfb9c6de7c23fac32c7888 X-VCS-Branch: master Date: Sun, 8 Jan 2023 18:58: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: b8abaeb3-5161-414c-87c2-c9e1939893ed X-Archives-Hash: 51ec686dd9802205304a57fd147ed5c6 commit: 92427dc0d11b26b03fcfb9c6de7c23fac32c7888 Author: Matoro Mahri users noreply github com> AuthorDate: Wed Dec 21 20:01:26 2022 +0000 Commit: Matt Turner gentoo org> CommitDate: Sun Jan 8 18:57:02 2023 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=92427dc0 Reimplement --kernel-cross-compile= for genkernel 4.x This restores the --kernel-cross-compile= option from genkernel 3.x, which controls only the --kernel-xxx= options as opposed to both kernel and userspace options controlled by --cross-compile=. Also adds documentation on the missing options in default genkernel.conf. Bug: https://bugs.gentoo.org/716862 Signed-off-by: Matoro Mahri users.noreply.github.com> Signed-off-by: Matt Turner gentoo.org> gen_cmdline.sh | 6 ++++++ gen_determineargs.sh | 23 ++++++++++++----------- genkernel.conf | 25 +++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 11 deletions(-) diff --git a/gen_cmdline.sh b/gen_cmdline.sh index 0cba7d1..2a4d3de 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -86,6 +86,8 @@ longusage() { echo " Low-Level Compile settings" echo " --cross-compile=" echo " Target triple (i.e. aarch64-linux-gnu) to build for" + echo " --kernel-cross-compile=" + echo " Target triple (i.e. aarch64-linux-gnu) to build kernel for" echo " --kernel-ar= Archiver to use for kernel" echo " --kernel-as= Assembler to use for kernel" echo " --kernel-cc= Compiler to use for kernel (e.g. distcc)" @@ -304,6 +306,10 @@ parse_cmdline() { CMD_CROSS_COMPILE="${*#*=}" print_info 3 "CMD_CROSS_COMPILE: ${CMD_CROSS_COMPILE}" ;; + --kernel-cross-compile=*) + CMD_KERNEL_CROSS_COMPILE="${*#*=}" + print_info 3 "CMD_KERNEL_CROSS_COMPILE: ${CMD_KERNEL_CROSS_COMPILE}" + ;; --kernel-ar=*) CMD_KERNEL_AR="${*#*=}" print_info 3 "CMD_KERNEL_AR: ${CMD_KERNEL_AR}" diff --git a/gen_determineargs.sh b/gen_determineargs.sh index ef69414..7122ea3 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -353,19 +353,20 @@ determine_real_args() { set_config_with_override STRING CHOST CMD_CHOST "${DEFAULT_CHOST}" set_config_with_override STRING MAKEOPTS CMD_MAKEOPTS "${DEFAULT_MAKEOPTS}" set_config_with_override STRING NICE CMD_NICE "10" - set_config_with_override STRING KERNEL_AS CMD_KERNEL_AS "${DEFAULT_KERNEL_AS}" - set_config_with_override STRING KERNEL_AR CMD_KERNEL_AR "${DEFAULT_KERNEL_AR}" - set_config_with_override STRING KERNEL_CC CMD_KERNEL_CC "${DEFAULT_KERNEL_CC}" - set_config_with_override STRING KERNEL_CFLAGS CMD_KERNEL_CFLAGS "${DEFAULT_KERNEL_CFLAGS}" + set_config_with_override STRING KERNEL_CROSS_COMPILE CMD_KERNEL_CROSS_COMPILE + set_config_with_override STRING KERNEL_AS CMD_KERNEL_AS "$([[ -n "${KERNEL_CROSS_COMPILE}" ]] && echo "${KERNEL_CROSS_COMPILE}-${DEFAULT_KERNEL_AS}" || echo "${DEFAULT_KERNEL_AS}")" + set_config_with_override STRING KERNEL_AR CMD_KERNEL_AR "$([[ -n "${KERNEL_CROSS_COMPILE}" ]] && echo "${KERNEL_CROSS_COMPILE}-${DEFAULT_KERNEL_AR}" || echo "${DEFAULT_KERNEL_AR}")" + set_config_with_override STRING KERNEL_CC CMD_KERNEL_CC "$([[ -n "${KERNEL_CROSS_COMPILE}" ]] && echo "${KERNEL_CROSS_COMPILE}-${DEFAULT_KERNEL_CC}" || echo "${DEFAULT_KERNEL_CC}")" set_config_with_override STRING KERNEL_CXX CMD_KERNEL_CXX "${DEFAULT_KERNEL_CXX}" - set_config_with_override STRING KERNEL_LD CMD_KERNEL_LD "${DEFAULT_KERNEL_LD}" - set_config_with_override STRING KERNEL_NM CMD_KERNEL_NM "${DEFAULT_KERNEL_NM}" + set_config_with_override STRING KERNEL_CFLAGS CMD_KERNEL_CFLAGS "${DEFAULT_KERNEL_CFLAGS}" + set_config_with_override STRING KERNEL_LD CMD_KERNEL_LD "$([[ -n "${KERNEL_CROSS_COMPILE}" ]] && echo "${KERNEL_CROSS_COMPILE}-${DEFAULT_KERNEL_LD}" || echo "${DEFAULT_KERNEL_LD}")" set_config_with_override STRING KERNEL_MAKE CMD_KERNEL_MAKE "${DEFAULT_KERNEL_MAKE}" - set_config_with_override STRING KERNEL_OBJCOPY CMD_KERNEL_OBJCOPY "${DEFAULT_KERNEL_OBJCOPY}" - set_config_with_override STRING KERNEL_OBJDUMP CMD_KERNEL_OBJDUMP "${DEFAULT_KERNEL_OBJDUMP}" - set_config_with_override STRING KERNEL_RANLIB CMD_KERNEL_RANLIB "${DEFAULT_KERNEL_RANLIB}" - set_config_with_override STRING KERNEL_READELF CMD_KERNEL_READELF "${DEFAULT_KERNEL_READELF}" - set_config_with_override STRING KERNEL_STRIP CMD_KERNEL_STRIP "${DEFAULT_KERNEL_STRIP}" + set_config_with_override STRING KERNEL_NM CMD_KERNEL_NM "$([[ -n "${KERNEL_CROSS_COMPILE}" ]] && echo "${KERNEL_CROSS_COMPILE}-${DEFAULT_KERNEL_NM}" || echo "${DEFAULT_KERNEL_NM}")" + set_config_with_override STRING KERNEL_OBJCOPY CMD_KERNEL_OBJCOPY "$([[ -n "${KERNEL_CROSS_COMPILE}" ]] && echo "${KERNEL_CROSS_COMPILE}-${DEFAULT_KERNEL_OBJCOPY}" || echo "${DEFAULT_KERNEL_OBJCOPY}")" + set_config_with_override STRING KERNEL_OBJDUMP CMD_KERNEL_OBJDUMP "$([[ -n "${KERNEL_CROSS_COMPILE}" ]] && echo "${KERNEL_CROSS_COMPILE}-${DEFAULT_KERNEL_OBJDUMP}" || echo "${DEFAULT_KERNEL_OBJDUMP}")" + set_config_with_override STRING KERNEL_RANLIB CMD_KERNEL_RANLIB "$([[ -n "${KERNEL_CROSS_COMPILE}" ]] && echo "${KERNEL_CROSS_COMPILE}-${DEFAULT_KERNEL_RANLIB}" || echo "${DEFAULT_KERNEL_RANLIB}")" + set_config_with_override STRING KERNEL_READELF CMD_KERNEL_READELF "$([[ -n "${KERNEL_CROSS_COMPILE}" ]] && echo "${KERNEL_CROSS_COMPILE}-${DEFAULT_KERNEL_READELF}" || echo "${DEFAULT_KERNEL_READELF}")" + set_config_with_override STRING KERNEL_STRIP CMD_KERNEL_STRIP "$([[ -n "${KERNEL_CROSS_COMPILE}" ]] && echo "${KERNEL_CROSS_COMPILE}-${DEFAULT_KERNEL_STRIP}" || echo "${DEFAULT_KERNEL_STRIP}")" set_config_with_override STRING UTILS_AS CMD_UTILS_AS "${DEFAULT_UTILS_AS}" set_config_with_override STRING UTILS_AR CMD_UTILS_AR "${DEFAULT_UTILS_AR}" set_config_with_override STRING UTILS_CC CMD_UTILS_CC "${DEFAULT_UTILS_CC}" diff --git a/genkernel.conf b/genkernel.conf index 7045e18..9a262f0 100644 --- a/genkernel.conf +++ b/genkernel.conf @@ -217,6 +217,26 @@ NOCOLOR="false" # GNU Make to use for kernel. See also the --kernel-make command line option. #KERNEL_MAKE="make" +# objcopy utility to use for the kernel. See also the --kernel-objcopy command +# line option. +#KERNEL_OBJCOPY="objcopy" + +# objdump utility to use for the kernel. See also the --kernel-objdump command +# line option. +#KERNEL_OBJDUMP="objdump" + +# ranlib utility to use for the kernel. See also the --kernel-ranlib command +# line option. +#KERNEL_RANLIB="ranlib" + +# readelf utility to use for the kernel. See also the --kernel-readelf command +# line option. +#KERNEL_READELF="readelf" + +# strip utility to use for the kernel. See also the --kernel-strip command line +# option. +#KERNEL_STRIP="strip" + # Assembler to use for the utilities. See also the --utils-as command line # option. #UTILS_AS="as" @@ -248,6 +268,11 @@ NOCOLOR="false" # cross-compile, leave blank for auto detection. #CROSS_COMPILE="" +# Target triple (i.e. aarch64-linux-gnu) to build kernel for. Utilities will be +# built for the native target, not this target. If you do not cross-compile, +# leave blank. +#KERNEL_CROSS_COMPILE="" + # Override default make target (bzImage). See also the --kernel-target # command line option. Useful to build a uImage on arm. #KERNEL_MAKE_DIRECTIVE_OVERRIDE="fooImage"