aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatoro Mahri <matoro@users.noreply.github.com>2022-12-21 15:01:26 -0500
committerMatt Turner <mattst88@gentoo.org>2023-01-08 13:57:02 -0500
commit92427dc0d11b26b03fcfb9c6de7c23fac32c7888 (patch)
tree963702f8043429c8fe159eecf7c184d3d1ea93dc
parentgenkernel 4.3.1 (diff)
downloadgenkernel-92427dc0d11b26b03fcfb9c6de7c23fac32c7888.tar.gz
genkernel-92427dc0d11b26b03fcfb9c6de7c23fac32c7888.tar.bz2
genkernel-92427dc0d11b26b03fcfb9c6de7c23fac32c7888.zip
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 <matoro@users.noreply.github.com> Signed-off-by: Matt Turner <mattst88@gentoo.org>
-rwxr-xr-xgen_cmdline.sh6
-rwxr-xr-xgen_determineargs.sh23
-rw-r--r--genkernel.conf25
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=<target-triplet>"
echo " Target triple (i.e. aarch64-linux-gnu) to build for"
+ echo " --kernel-cross-compile=<target-triplet>"
+ echo " Target triple (i.e. aarch64-linux-gnu) to build kernel for"
echo " --kernel-ar=<archiver> Archiver to use for kernel"
echo " --kernel-as=<assembler> Assembler to use for kernel"
echo " --kernel-cc=<compiler> 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"