mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-15 08:56:58 +02:00
bump(eclass): Sync all kernel related eclasses with upstream.
Forgot to update these as part of the recent systemd upgrade.
This commit is contained in:
parent
d3b31df9f4
commit
5c5cbd35e2
@ -1,6 +1,6 @@
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.284 2013/04/29 22:14:23 tomwij Exp $
|
||||
# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.287 2013/07/31 21:25:50 hasufell Exp $
|
||||
|
||||
# Description: kernel.eclass rewrite for a clean base regarding the 2.6
|
||||
# series of kernel with back-compatibility for 2.4
|
||||
@ -689,7 +689,6 @@ install_headers() {
|
||||
emake headers_install INSTALL_HDR_PATH="${D}"/${ddir}/.. ${xmakeopts} || die
|
||||
|
||||
# let other packages install some of these headers
|
||||
rm -rf "${D}"/${ddir}/sound #alsa-headers
|
||||
rm -rf "${D}"/${ddir}/scsi #glibc/uclibc/etc...
|
||||
return 0
|
||||
fi
|
||||
@ -815,7 +814,8 @@ postinst_sources() {
|
||||
# optionally display security unsupported message
|
||||
# Start with why
|
||||
if [[ ${K_SECURITY_UNSUPPORTED} = deblob ]]; then
|
||||
ewarn "Deblobbed kernels are UNSUPPORTED by Gentoo Security."
|
||||
ewarn "Deblobbed kernels may not be up-to-date security-wise"
|
||||
ewarn "as they depend on external scripts."
|
||||
elif [[ -n ${K_SECURITY_UNSUPPORTED} ]]; then
|
||||
ewarn "${PN} is UNSUPPORTED by Gentoo Security."
|
||||
fi
|
||||
|
@ -1,8 +0,0 @@
|
||||
# Copyright 1999-2009 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/eclass/kernel.eclass,v 1.61 2009/11/30 04:19:36 abcd Exp $
|
||||
|
||||
# @DEAD
|
||||
# Replaced by kernel-2.eclass
|
||||
# To be removed on 2011/11/30.
|
||||
ewarn "Please fix your package (${CATEGORY}/${PF}) to not use ${ECLASS}.eclass"
|
@ -1,6 +1,6 @@
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.96 2013/01/24 20:47:23 vapier Exp $
|
||||
# $Header: /var/cvsroot/gentoo-x86/eclass/linux-info.eclass,v 1.100 2013/02/10 07:53:31 vapier Exp $
|
||||
|
||||
# @ECLASS: linux-info.eclass
|
||||
# @MAINTAINER:
|
||||
@ -111,9 +111,6 @@ inherit toolchain-funcs versionator
|
||||
|
||||
EXPORT_FUNCTIONS pkg_setup
|
||||
|
||||
DEPEND=""
|
||||
RDEPEND=""
|
||||
|
||||
# Overwritable environment Var's
|
||||
# ---------------------------------------
|
||||
KERNEL_DIR="${KERNEL_DIR:-${ROOT}usr/src/linux}"
|
||||
@ -183,8 +180,10 @@ getfilevar() {
|
||||
basedname="$(dirname ${2})"
|
||||
unset ARCH
|
||||
|
||||
# We use nonfatal because we want the caller to take care of things #373151
|
||||
[[ ${EAPI:-0} == [0123] ]] && nonfatal() { "$@"; }
|
||||
echo -e "e:\\n\\t@echo \$(${1})\\ninclude ${basefname}" | \
|
||||
make -C "${basedname}" M="${S}" ${BUILD_FIXES} -s -f - 2>/dev/null
|
||||
nonfatal emake -C "${basedname}" M="${S}" ${BUILD_FIXES} -s -f - 2>/dev/null
|
||||
|
||||
ARCH=${myARCH}
|
||||
fi
|
||||
@ -245,7 +244,7 @@ linux_config_qa_check() {
|
||||
# It returns true if .config exists in a build directory otherwise false
|
||||
linux_config_src_exists() {
|
||||
export _LINUX_CONFIG_EXISTS_DONE=1
|
||||
[ -s "${KV_OUT_DIR}/.config" ]
|
||||
[[ -n ${KV_OUT_DIR} && -s ${KV_OUT_DIR}/.config ]]
|
||||
}
|
||||
|
||||
# @FUNCTION: linux_config_bin_exists
|
||||
@ -254,7 +253,7 @@ linux_config_src_exists() {
|
||||
# It returns true if .config exists in /proc, otherwise false
|
||||
linux_config_bin_exists() {
|
||||
export _LINUX_CONFIG_EXISTS_DONE=1
|
||||
[ -s "/proc/config.gz" ]
|
||||
[[ -s /proc/config.gz ]]
|
||||
}
|
||||
|
||||
# @FUNCTION: linux_config_exists
|
||||
@ -268,6 +267,20 @@ linux_config_exists() {
|
||||
linux_config_src_exists || linux_config_bin_exists
|
||||
}
|
||||
|
||||
# @FUNCTION: linux_config_path
|
||||
# @DESCRIPTION:
|
||||
# Echo the name of the config file to use. If none are found,
|
||||
# then return false.
|
||||
linux_config_path() {
|
||||
if linux_config_src_exists; then
|
||||
echo "${KV_OUT_DIR}/.config"
|
||||
elif linux_config_bin_exists; then
|
||||
echo "/proc/config.gz"
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# @FUNCTION: require_configured_kernel
|
||||
# @DESCRIPTION:
|
||||
# This function verifies that the current kernel is configured (it checks against the existence of .config)
|
||||
@ -291,11 +304,7 @@ require_configured_kernel() {
|
||||
# MUST call linux_config_exists first.
|
||||
linux_chkconfig_present() {
|
||||
linux_config_qa_check linux_chkconfig_present
|
||||
local RESULT config
|
||||
config="${KV_OUT_DIR}/.config"
|
||||
[ ! -f "${config}" ] && config="/proc/config.gz"
|
||||
RESULT="$(getfilevar_noexec CONFIG_${1} "${config}")"
|
||||
[ "${RESULT}" = "m" -o "${RESULT}" = "y" ] && return 0 || return 1
|
||||
[[ $(getfilevar_noexec "CONFIG_$1" "$(linux_config_path)") == [my] ]]
|
||||
}
|
||||
|
||||
# @FUNCTION: linux_chkconfig_module
|
||||
@ -307,11 +316,7 @@ linux_chkconfig_present() {
|
||||
# MUST call linux_config_exists first.
|
||||
linux_chkconfig_module() {
|
||||
linux_config_qa_check linux_chkconfig_module
|
||||
local RESULT config
|
||||
config="${KV_OUT_DIR}/.config"
|
||||
[ ! -f "${config}" ] && config="/proc/config.gz"
|
||||
RESULT="$(getfilevar_noexec CONFIG_${1} "${config}")"
|
||||
[ "${RESULT}" = "m" ] && return 0 || return 1
|
||||
[[ $(getfilevar_noexec "CONFIG_$1" "$(linux_config_path)") == m ]]
|
||||
}
|
||||
|
||||
# @FUNCTION: linux_chkconfig_builtin
|
||||
@ -323,11 +328,7 @@ linux_chkconfig_module() {
|
||||
# MUST call linux_config_exists first.
|
||||
linux_chkconfig_builtin() {
|
||||
linux_config_qa_check linux_chkconfig_builtin
|
||||
local RESULT config
|
||||
config="${KV_OUT_DIR}/.config"
|
||||
[ ! -f "${config}" ] && config="/proc/config.gz"
|
||||
RESULT="$(getfilevar_noexec CONFIG_${1} "${config}")"
|
||||
[ "${RESULT}" = "y" ] && return 0 || return 1
|
||||
[[ $(getfilevar_noexec "CONFIG_$1" "$(linux_config_path)") == y ]]
|
||||
}
|
||||
|
||||
# @FUNCTION: linux_chkconfig_string
|
||||
@ -339,10 +340,7 @@ linux_chkconfig_builtin() {
|
||||
# MUST call linux_config_exists first.
|
||||
linux_chkconfig_string() {
|
||||
linux_config_qa_check linux_chkconfig_string
|
||||
local config
|
||||
config="${KV_OUT_DIR}/.config"
|
||||
[ ! -f "${config}" ] && config="/proc/config.gz"
|
||||
getfilevar_noexec "CONFIG_${1}" "${config}"
|
||||
getfilevar_noexec "CONFIG_$1" "$(linux_config_path)"
|
||||
}
|
||||
|
||||
# Versioning Functions
|
||||
@ -464,6 +462,13 @@ get_version() {
|
||||
return 1
|
||||
fi
|
||||
|
||||
# See if the kernel dir is actually an output dir. #454294
|
||||
if [ -z "${KBUILD_OUTPUT}" -a -L "${KERNEL_DIR}/source" ]; then
|
||||
KBUILD_OUTPUT=${KERNEL_DIR}
|
||||
KERNEL_DIR=$(readlink -f "${KERNEL_DIR}/source")
|
||||
KV_DIR=${KERNEL_DIR}
|
||||
fi
|
||||
|
||||
if [ -z "${get_version_warning_done}" ]; then
|
||||
qeinfo "Found kernel source directory:"
|
||||
qeinfo " ${KV_DIR}"
|
||||
@ -483,7 +488,7 @@ get_version() {
|
||||
# KBUILD_OUTPUT, and we need this for .config and localversions-*
|
||||
# so we better find it eh?
|
||||
# do we pass KBUILD_OUTPUT on the CLI?
|
||||
OUTPUT_DIR="${OUTPUT_DIR:-${KBUILD_OUTPUT}}"
|
||||
local OUTPUT_DIR=${KBUILD_OUTPUT}
|
||||
|
||||
# keep track of it
|
||||
KERNEL_MAKEFILE="${KV_DIR}/Makefile"
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Copyright 1999-2012 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/eclass/linux-mod.eclass,v 1.108 2012/09/15 16:16:53 zmedico Exp $
|
||||
# $Header: /var/cvsroot/gentoo-x86/eclass/linux-mod.eclass,v 1.112 2013/03/26 08:17:26 ssuominen Exp $
|
||||
|
||||
# @ECLASS: linux-mod.eclass
|
||||
# @MAINTAINER:
|
||||
@ -77,12 +77,12 @@
|
||||
# insinto /lib/modules/${KV_FULL}/usb
|
||||
# doins module_usb.${KV_OBJ}
|
||||
|
||||
# There is also support for automated modprobe.d/modules.d(2.4) file generation.
|
||||
# There is also support for automated modprobe.d file generation.
|
||||
# This can be explicitly enabled by setting any of the following variables.
|
||||
|
||||
# @ECLASS-VARIABLE: MODULESD_<modulename>_ENABLED
|
||||
# @DESCRIPTION:
|
||||
# This is used to disable the modprobe.d/modules.d file generation otherwise the file will be
|
||||
# This is used to disable the modprobe.d file generation otherwise the file will be
|
||||
# always generated (unless no MODULESD_<modulename>_* variable is provided). Set to "no" to disable
|
||||
# the generation of the file and the installation of the documentation.
|
||||
|
||||
@ -91,7 +91,7 @@
|
||||
# This is a bash array containing a list of examples which should
|
||||
# be used. If you want us to try and take a guess set this to "guess".
|
||||
#
|
||||
# For each array_component it's added an options line in the modprobe.d/modules.d file
|
||||
# For each array_component it's added an options line in the modprobe.d file
|
||||
#
|
||||
# options array_component
|
||||
#
|
||||
@ -101,7 +101,7 @@
|
||||
# @DESCRIPTION:
|
||||
# This is a bash array containing a list of associated aliases.
|
||||
#
|
||||
# For each array_component it's added an alias line in the modprobe.d/modules.d file
|
||||
# For each array_component it's added an alias line in the modprobe.d file
|
||||
#
|
||||
# alias array_component
|
||||
#
|
||||
@ -127,10 +127,12 @@ EXPORT_FUNCTIONS pkg_setup pkg_preinst pkg_postinst src_install src_compile pkg_
|
||||
|
||||
IUSE="kernel_linux"
|
||||
SLOT="0"
|
||||
RDEPEND="kernel_linux? ( virtual/modutils )"
|
||||
DEPEND="${RDEPEND}
|
||||
sys-apps/sed
|
||||
kernel_linux? ( virtual/linux-sources )"
|
||||
if [[ -z ${VIRTUAL_MODUTILS} ]]; then
|
||||
RDEPEND="kernel_linux? ( virtual/modutils )"
|
||||
DEPEND="${RDEPEND}
|
||||
sys-apps/sed
|
||||
kernel_linux? ( virtual/linux-sources )"
|
||||
fi
|
||||
|
||||
# eclass utilities
|
||||
# ----------------------------------
|
||||
@ -233,27 +235,6 @@ update_depmod() {
|
||||
fi
|
||||
}
|
||||
|
||||
# internal function
|
||||
#
|
||||
# FUNCTION: update_modules
|
||||
# DESCRIPTION:
|
||||
# It calls the update-modules utility.
|
||||
update_modules() {
|
||||
debug-print-function ${FUNCNAME} $*
|
||||
|
||||
if [ -x /sbin/update-modules ] && \
|
||||
grep -v -e "^#" -e "^$" "${D}"/etc/modules.d/* >/dev/null 2>&1; then
|
||||
ebegin "Updating modules.conf"
|
||||
/sbin/update-modules
|
||||
eend $?
|
||||
elif [ -x /sbin/update-modules ] && \
|
||||
grep -v -e "^#" -e "^$" "${D}"/etc/modules.d/* >/dev/null 2>&1; then
|
||||
ebegin "Updating modules.conf"
|
||||
/sbin/update-modules
|
||||
eend $?
|
||||
fi
|
||||
}
|
||||
|
||||
# internal function
|
||||
#
|
||||
# FUNCTION: move_old_moduledb
|
||||
@ -355,9 +336,9 @@ get-KERNEL_CC() {
|
||||
#
|
||||
# FUNCTION:
|
||||
# USAGE: /path/to/the/modulename_without_extension
|
||||
# RETURN: A file in /etc/modules.d/ (kernel < 2.6) or /etc/modprobe.d/ (kernel >= 2.6)
|
||||
# RETURN: A file in /etc/modprobe.d
|
||||
# DESCRIPTION:
|
||||
# This function will generate and install the neccessary modprobe.d/modules.d file from the
|
||||
# This function will generate and install the neccessary modprobe.d file from the
|
||||
# information contained in the modules exported parms.
|
||||
# (see the variables MODULESD_<modulename>_ENABLED, MODULESD_<modulename>_EXAMPLES,
|
||||
# MODULESD_<modulename>_ALIASES, MODULESD_<modulename>_ADDITION and MODULESD_<modulename>_DOCS).
|
||||
@ -402,13 +383,13 @@ generate_modulesd() {
|
||||
[[ -z ${!module_*} ]] && return 0
|
||||
|
||||
# OK so now if we have got this far, then we know we want to continue
|
||||
# and generate the modules.d file.
|
||||
# and generate the modprobe.d file.
|
||||
module_modinfo="$(modinfo -p ${currm_path}.${KV_OBJ})"
|
||||
module_config="${T}/modulesd-${currm}"
|
||||
|
||||
ebegin "Preparing file for modules.d"
|
||||
ebegin "Preparing file for modprobe.d"
|
||||
#-----------------------------------------------------------------------
|
||||
echo "# modules.d configuration file for ${currm}" >> "${module_config}"
|
||||
echo "# modprobe.d configuration file for ${currm}" >> "${module_config}"
|
||||
#-----------------------------------------------------------------------
|
||||
[[ -n ${module_docs} ]] && \
|
||||
echo "# For more information please read:" >> "${module_config}"
|
||||
@ -494,11 +475,7 @@ generate_modulesd() {
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
# then we install it
|
||||
if kernel_is ge 2 6; then
|
||||
insinto /etc/modprobe.d
|
||||
else
|
||||
insinto /etc/modules.d
|
||||
fi
|
||||
insinto /etc/modprobe.d
|
||||
newins "${module_config}" "${currm_path//*\/}.conf"
|
||||
|
||||
# and install any documentation we might have.
|
||||
@ -687,7 +664,7 @@ linux-mod_src_compile() {
|
||||
# It install the modules specified in MODULES_NAME. The modules should be inside the ${objdir}
|
||||
# directory and they are installed inside /lib/modules/${KV_FULL}/${libdir}.
|
||||
#
|
||||
# The modprobe.d/modules.d configuration file is automatically generated if the
|
||||
# The modprobe.d configuration file is automatically generated if the
|
||||
# MODULESD_<modulename>_* variables are defined. The only way to stop this process is by
|
||||
# setting MODULESD_<modulename>_ENABLED=no. At the end the documentation specified via
|
||||
# MODULESD_<modulename>_DOCS is also installed.
|
||||
@ -727,27 +704,24 @@ linux-mod_pkg_preinst() {
|
||||
debug-print-function ${FUNCNAME} $*
|
||||
|
||||
[ -d "${D}lib/modules" ] && UPDATE_DEPMOD=true || UPDATE_DEPMOD=false
|
||||
[ -d "${D}etc/modules.d" ] && UPDATE_MODULES=true || UPDATE_MODULES=false
|
||||
[ -d "${D}lib/modules" ] && UPDATE_MODULEDB=true || UPDATE_MODULEDB=false
|
||||
}
|
||||
|
||||
# @FUNCTION: linux-mod_pkg_postinst
|
||||
# @DESCRIPTION:
|
||||
# It executes /sbin/depmod and adds the package to the /var/lib/module-rebuild/moduledb
|
||||
# database (if ${D}/lib/modules is created) and it runs /sbin/update-modules
|
||||
# (if ${D}/etc/modules.d is created).
|
||||
# database (if ${D}/lib/modules is created)"
|
||||
linux-mod_pkg_postinst() {
|
||||
debug-print-function ${FUNCNAME} $*
|
||||
|
||||
${UPDATE_DEPMOD} && update_depmod;
|
||||
${UPDATE_MODULES} && update_modules;
|
||||
${UPDATE_MODULEDB} && update_moduledb;
|
||||
}
|
||||
|
||||
# @FUNCTION: linux-mod_pkg_postrm
|
||||
# @DESCRIPTION:
|
||||
# It removes the package from the /var/lib/module-rebuild/moduledb database but it doens't
|
||||
# call /sbin/depmod and /sbin/update-modules because the modules are still installed.
|
||||
# call /sbin/depmod because the modules are still installed.
|
||||
linux-mod_pkg_postrm() {
|
||||
debug-print-function ${FUNCNAME} $*
|
||||
remove_moduledb;
|
||||
|
Loading…
Reference in New Issue
Block a user