From 5c344dfb729b9b594592309be6f8e9ab1181cddc Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Fri, 3 Jul 2020 12:11:11 +0200 Subject: [PATCH] eclass: sync linux-info.eclass to fix Kernel build issues Kernel 5.8-rc2 or newer added a commit https://github.com/torvalds/linux/commit/f2f02ebd8f3833626642688b2d2c6a7b3c141fa9 ("kbuild: improve cc-option to clean up all temporary files") , which causes make commands to create an object output directory. Apparently harmless. The commit was backported to stable Kernels, 4.19.131, 5.4.50, 5.7.7. In Flatcar and Gentoo, however, `getfilevar()` in `linux-info.eclass` runs a make command, which creates `${M}`, an object output directory, with a root account. As Gentoo sandbox creates everything as non-root account, the subsequent steps like `src_unpack` fail to touch the same directory. Upstream Gentoo already has a fix https://github.com/gentoo/gentoo/commit/5a3acd443c3347568d14d000776f46177317744a ("linux-info.eclass: Pass M=${T} to the Linux Makefile unconditionally."). See also https://bugs.gentoo.org/729178 . So simply sync `linux-info.eclass` with Gentoo. --- .../portage-stable/eclass/linux-info.eclass | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/sdk_container/src/third_party/portage-stable/eclass/linux-info.eclass b/sdk_container/src/third_party/portage-stable/eclass/linux-info.eclass index 98ec0ac8da..11a890889e 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/linux-info.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/linux-info.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2018 Gentoo Foundation +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: linux-info.eclass @@ -159,14 +159,14 @@ qeerror() { qout eerror "${@}" ; } # --------------------------------------- # @FUNCTION: getfilevar -# @USAGE: variable configfile +# @USAGE: # @RETURN: the value of the variable # @DESCRIPTION: # It detects the value of the variable defined in the file configfile. This is # done by including the configfile, and printing the variable with Make. # It WILL break if your makefile has missing dependencies! getfilevar() { - local ERROR basefname basedname myARCH="${ARCH}" M="${S}" + local ERROR basefname basedname myARCH="${ARCH}" ERROR=0 [ -z "${1}" ] && ERROR=1 @@ -184,18 +184,15 @@ getfilevar() { # We use nonfatal because we want the caller to take care of things #373151 [[ ${EAPI:-0} == [0123] ]] && nonfatal() { "$@"; } - case ${EBUILD_PHASE_FUNC} in - pkg_info|pkg_nofetch|pkg_pretend) M="${T}" ;; - esac echo -e "e:\\n\\t@echo \$(${1})\\ninclude ${basefname}" | \ - nonfatal emake -C "${basedname}" M="${M}" ${BUILD_FIXES} -s -f - 2>/dev/null + nonfatal emake -C "${basedname}" M="${T}" ${BUILD_FIXES} -s -f - 2>/dev/null ARCH=${myARCH} fi } # @FUNCTION: getfilevar_noexec -# @USAGE: variable configfile +# @USAGE: # @RETURN: the value of the variable # @DESCRIPTION: # It detects the value of the variable defined in the file configfile. @@ -310,7 +307,7 @@ require_configured_kernel() { } # @FUNCTION: linux_chkconfig_present -# @USAGE: option +# @USAGE: