Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Copyright 1999-2012 Gentoo Foundation
- # Distributed under the terms of the GNU General Public License v2
- # $Header: $
- # Original Author: mavriq@gmail.com
- inherit savedconfig
- EXPORT_FUNCTIONS src_configure src_install
- IUSE="nohighmem highmem4g highmem64g"
- REQUIRED_USE="x86? (
- nohighmem? ( !highmem4g !highmem64g )
- highmem4g? ( !nohighmem !highmem64g )
- highmem64g? ( !nohighmem !highmem4g )
- )
- !x86? ( !nohighmem !highmem4g !highmem64g )
- "
- kernel_config_option() {
- config="${S}/.config"
- origkey="$1"
- key=`echo "$1"| tr 'a-z' 'A-Z'`
- value="$2"
- case "${value}" in
- '') use "${origkey}" \
- && kernel_config_option "${key}" y \
- || kernel_config_option "${key}" n
- return 0 ;;
- n)
- einfo "In ${config} disagle CONFIG_${key}"
- sed -i -e "s:CONFIG_${key}=.:# CONFIG_${key} is not set:g" "${config}" ;;
- *)
- einfo "In ${config} set CONFIG_${key}=${value}"
- sed -i -e "s:.*\<CONFIG_${key}\>.*set:CONFIG_${key}=${value}:g" "${config}" ;;
- ## ^^--- y or m or any value (задел на будущее)
- esac
- }
- calculate-kernel-tuneconfig_src_configure() {
- export KERNEL_ORIG_CONFIGNAME=$(cl-kernel -v --filter 'cl_kernel_config$' | sed -nr 's/.*\[.\]\s//p')
- if ! use savedconfig ; then
- cp ${KERNEL_ORIG_CONFIGNAME} .config
- return
- fi
- restore_config ".config"
- if [ ! -f ".config" ]; then
- ewarn "Could not locate user configfile, so we will use ${KERNEL_ORIG_CONFIGNAME}"
- cp -v "${KERNEL_ORIG_CONFIGNAME}" .config
- fi
- ## Correct highmem parameter if need
- if use nohighmem || use highmem4g || use highmem64g; then
- ebegin "Correct highmem parameter"
- kernel_config_option nohighmem
- kernel_config_option highmem4g
- kernel_config_option highmem64g
- ( use nohighmem || use highmem64g ) && kernel_config_option X86_PAE y
- eend 0
- else
- einfo "Don't touch highmem parameter"
- fi
- yes ''| emake -j1 oldconfig &>make_oldconfig.log
- #yes ''| make -j1 oldconfig &>make_oldconfig.log
- if [ "$?" -ne 0 ] ; then
- cat make_oldconfig.log
- die "Error during make oldconfig"
- fi
- diff -su ${KERNEL_ORIG_CONFIGNAME} .config >"${PF}:${SLOT}.diff"
- }
- calculate-kernel-tuneconfig_src_install() {
- use savedconfig || return
- save_config ${S}/.config
- insinto /etc/portage/savedconfig/${CATEGORY}
- doins "${PF}:${SLOT}.diff"
- }
Add Comment
Please, Sign In to add comment