diff options
author | Oleg Vinichenko <oleg@funtoo.org> | 2017-12-06 09:52:25 +0000 |
---|---|---|
committer | Oleg Vinichenko <oleg@funtoo.org> | 2017-12-06 09:52:25 +0000 |
commit | c561e3621e30b7931e01f4ff47d23f81162ed0bd (patch) | |
tree | 3cd9a7521c1981a2ba7a4bbf2fd0770feb0aac78 | |
parent | FL-3671: add workaround for the f2fs rootfs (diff) | |
download | genkernel-c561e3621e30b7931e01f4ff47d23f81162ed0bd.tar.gz genkernel-c561e3621e30b7931e01f4ff47d23f81162ed0bd.tar.bz2 genkernel-c561e3621e30b7931e01f4ff47d23f81162ed0bd.zip |
FL-4442: add workaround for linux-4.14v3.4.40.19-funtoo
-rwxr-xr-x | gen_compile.sh | 32 | ||||
-rwxr-xr-x | gen_funcs.sh | 8 | ||||
-rwxr-xr-x | genkernel | 4 |
3 files changed, 24 insertions, 20 deletions
diff --git a/gen_compile.sh b/gen_compile.sh index b8ffcb0..a311178 100755 --- a/gen_compile.sh +++ b/gen_compile.sh @@ -323,26 +323,22 @@ compile_kernel() { compile_generic "${KERNEL_MAKE_DIRECTIVE_2}" kernel fi - local ext_fw_build="yes" - - local fw_makefile='fgrep firmware_install "${BUILD_SRC}"/Makefile' - if [ -z "${fw_makefile}" ] - then - print_info 1 " >> Disabling firmware build due to firmware_install target not being available..." - ext_fw_build="no" - else - local firmware_in_kernel_line=`fgrep CONFIG_FIRMWARE_IN_KERNEL "${BUILD_DST}"/.config` - if [ -n "${firmware_in_kernel_line}" -a "${firmware_in_kernel_line}" == CONFIG_FIRMWARE_IN_KERNEL=y ] - then - ext_fw_build="no" + if isTrue "${FIRMWARE}" && [ ! -e "${BUILD_SRC}/ihex2fw.c" ] ; then + # Kernel v4.14 removed firmware from the kernel sources, including the + # ihex2fw.c tool source. Try and detect the tool to see if we are in >=v4.14 + print_warning 1 " >> Linux v4.14 removed in-kernel firmware, you MUST install the sys-kernel/linux-firmware package!" + elif isTrue "${FIRMWARE_INSTALL}" ; then + local cfg_CONFIG_FIRMWARE_IN_KERNEL=$(kconfig_get_opt "${BUILD_DST}/.config" CONFIG_FIRMWARE_IN_KERNEL) + if isTrue "$cfg_CONFIG_FIRMWARE_IN_KERNEL"; then print_info 1 " >> Not installing firmware as it's included in the kernel already (CONFIG_FIRMWARE_IN_KERNEL=y)..." - fi - fi - - if [ "$ext_fw_build" == "yes" ] - then - print_info 1 " >> Installing firmware ('make firmware_install')..." + else + print_info 1 " >> Installing firmware ('make firmware_install') due to CONFIG_FIRMWARE_IN_KERNEL != y..." + [ "${INSTALL_MOD_PATH}" != '' ] && export INSTALL_MOD_PATH + [ "${INSTALL_FW_PATH}" != '' ] && export INSTALL_FW_PATH MAKEOPTS="${MAKEOPTS} -j1" compile_generic "firmware_install" kernel + fi + else + print_info 1 " >> Not installing firmware as requested by configuration FIRMWARE_INSTALL=no..." fi local tmp_kernel_binary=$(find_kernel_binary ${KERNEL_BINARY_OVERRIDE:-${KERNEL_BINARY}}) diff --git a/gen_funcs.sh b/gen_funcs.sh index 2938c4c..6197cbb 100755 --- a/gen_funcs.sh +++ b/gen_funcs.sh @@ -535,3 +535,11 @@ find_kernel_binary() { cd "${curdir}" echo "${tmp_kernel_binary}" } + + +config_get_opt() { + kconfig="$1" + optname="$2" + sed -n "${kconfig}" \ + -e "/^#\? \?${optname}[ =].*/{ s/.*${optname}[ =]//g; s/is not set\| +//g; p; q }" +} @@ -1,8 +1,8 @@ -#!/bin/bash +/#!/bin/bash # $Id$ PATH="${PATH}:/sbin:/usr/sbin" -GK_V='3.4.40.15-funtoo' +GK_V='3.4.40.19-funtoo' # Set the default for TMPDIR. May be modified by genkernel.conf or the # --tempdir command line option. |