#-------------------------------------------------------------------------
@@ -354,44 +354,53 @@ function invoke_uname_change()
#-------------------------------------------------------------------------
function devoke_uname_change()
{
- if [[ $(installed_version unamechange) ]] ; then
- unset UNAME_CHANGE_SYSNAME
- unset UNAME_CHANGE_NODENAME
- unset UNAME_CHANGE_RELEASE
- unset UNAME_CHANGE_VERSION
- unset UNAME_CHANGE_MACHINE
- unset UNAME_CHANGE_DOMAINNAME
-
- export LD_PRELOAD="${LD_PRELOAD/\/usr\/lib\/unamechange.so/}"
- fi
+ if [[ $(installed_version unamechange) ]] ; then
+ unset UNAME_CHANGE_SYSNAME
+ unset UNAME_CHANGE_NODENAME
+ unset UNAME_CHANGE_RELEASE
+ unset UNAME_CHANGE_VERSION
+ unset UNAME_CHANGE_MACHINE
+ unset UNAME_CHANGE_DOMAINNAME
+
+ export LD_PRELOAD="${LD_PRELOAD/\/usr\/lib\/unamechange.so/}"
+ fi
}
#-----------------------------------------------------------------------
-## Get the running kernel config status of a some part of the kernel
-## given by $1. Used for spells that don't have linux triggers
+## Get the kernel config status of the kernel option specified by $2.
+## Kernel version is given by $1.
+##
+## If a configure file is found print the requested config status (if
+## any) and return 0, otherwise return 1.
+##-----------------------------------------------------------------------
+function get_kernel_config_ver()
+{
+ local i
+ for i in /proc/config /boot/config-"$1" /lib/modules/"$1"/build/.config
+ do
+ if [ -f "$i" ]; then
+ cat "$i" && break
+ elif [ -f "$i.gz" ]; then
+ zcat "$i.gz" && break
+ elif [ -f "$i.bz2" ]; then
+ bzcat "$i.bz2" && break
+ elif [ -f "$i.xz" ]; then
+ xzcat "$i.xz" && break
+ elif [ -f "$i.lzma" ]; then
+ xzcat "$i.lzma" && break
+ fi
+ done | grep "^$2=" | awk -F= '{ if ($2) { print $2 }; exit (!$2) }'
+}
+
+#-----------------------------------------------------------------------
+## Get the running kernel config status of the running kernel option
+## given by $1.
##
-## $1 string Config variable to look for
+## See also: get_specified_kernel_config
#-----------------------------------------------------------------------
function get_running_kernel_config()
{
- local KVER
- # use proc interface because even inside a uname change invoke this
- # still returns the version of the running kernel
- if [ -f /proc/sys/kernel/osrelease ] ; then
- KVER=$(cat /proc/sys/kernel/osrelease)
- else
- # apparently you don't have proc mount
- KVER=$(uname -r)
- fi
- if [ -f /proc/config.gz ] ; then
- echo $(zgrep "^$1=" /proc/config.gz | awk -F= '{ print $2 }')
- elif [ -f /boot/config-$KVER ] ; then
- echo $(grep "^$1=" /boot/config-$KVER | awk -F= '{ print $2
}')
- elif [ -f /usr/src/linux-$KVER/.config ] ; then
- echo $(grep "^$1=" /usr/src/linux-$KVER/.config | awk -F= '{
print $2 }')
- else
- echo "-1"
- fi
+ get_kernel_config_ver $(get_running_kernel_version) "$1"
}
#-------------------------------------------------------------------------
@@ -402,14 +411,7 @@ function get_running_kernel_config()
#-------------------------------------------------------------------------
function get_sorcery_kernel_config()
{
- local KVER=$(get_kernel_version)
- if [ -f /boot/config-$KVER ] ; then
- echo $(grep "^$1=" /boot/config-$KVER | awk -F= '{ print $2
}')
- elif [ -f /usr/src/linux-$KVER/.config ] ; then
- echo $(grep "^$1=" /usr/src/linux-$KVER/.config | awk -F= '{
print $2 }')
- else
- echo "-1"
- fi
+ get_kernel_config_ver $(get_kernel_version) || echo "-1"
}
@@ -590,31 +592,6 @@ function get_sorcery_kernel_version()
}
#-----------------------------------------------------------------------
-## Print the kernel config status of the running kernel for the option
-## defined in $1.
-## If a configure file is found print the requested config status (if
-## any) and return 0, otherwise return 1.
-#-----------------------------------------------------------------------
-function get_running_kernel_config()
-{
- if [[ -f /proc/config.gz ]]
- then
- zgrep "^$1=" /proc/config.gz | cut -d= -f2
- else
- local KVER="$(get_running_kernel_version)"
- if [[ -f "/boot/config-$KVER" ]]
- then
- grep "^$1=" "/boot/config-$KVER" | cut -d= -f2
- elif [[ -f "/usr/src/linux-$KVER/.config" ]]
- then
- grep "^$1=" "/usr/src/linux-$KVER/.config" | cut -d= -f2
- else
- return 1
- fi
- fi
-}
-
-#-----------------------------------------------------------------------
## Print the kernel config status of the installed linux spell for the
## option defined in $1.
## If the linux spell is installed and a configure file is found print
@@ -626,15 +603,7 @@ function get_sorcery_kernel_config()
local KVER="$(installed_version linux)"
if [[ $KVER ]]
then
- if [[ -f "/boot/config-$KVER" ]]
- then
- grep "^$1=" "/boot/config-$KVER" | cut -d= -f2
- elif [[ -f "/usr/src/linux-$KVER/.config" ]]
- then
- grep "^$1=" "/usr/src/linux-$KVER/.config" | cut -d= -f2
- else
- return 1
- fi
+ get_kernel_config_ver "$KVER" "$1"
else
return 1
fi
@@ -651,15 +620,7 @@ function get_kernel_config()
{
if [[ $USE_KERNEL_VERSION ]]
then
- if [[ -f "/boot/config-$USE_KERNEL_VERSION" ]]
- then
- grep "^$1=" "/boot/config-$USE_KERNEL_VERSION" | cut -d= -f2
- elif [[ -f "/usr/src/linux-$USE_KERNEL_VERSION/.config" ]]
- then
- grep "^$1=" "/usr/src/linux-$USE_KERNEL_VERSION/.config" | cut -d= -f2
- else
- return 1
- fi
+ get_kernel_config_ver "$USE_KERNEL_VERSION" "$1"
else
get_sorcery_kernel_config "$1" || get_running_kernel_config "$1"
fi
diff --git a/audio-libs/libifp/CONFIGURE b/audio-libs/libifp/CONFIGURE
index 23de165..1c286d4 100755
--- a/audio-libs/libifp/CONFIGURE
+++ b/audio-libs/libifp/CONFIGURE
@@ -2,5 +2,5 @@
if spell_ok linux; then
config_query_option KERMOD_OPTS \
"Build the kernel module ?" n \
- "--with-kmodule=${INSTALL_ROOT}/usr/src/linux-$(get_kernel_version)"
"--without-kmodule"
+
"--with-kmodule=${INSTALL_ROOT}/lib/modules/$(get_kernel_version)/build"
"--without-kmodule"
fi
diff --git a/audio-libs/libifp/HISTORY b/audio-libs/libifp/HISTORY
index 06a3001..3e823ca 100644
--- a/audio-libs/libifp/HISTORY
+++ b/audio-libs/libifp/HISTORY
@@ -1,3 +1,6 @@
+2010-04-11 Ismael Luceno <ismael AT sourcemage.org>
+ * CONFIGURE, INSTALL: Fix kernel path
+
2008-08-04 Julien "_kaze_" ROZO <julien AT rozo.org>
* BUILD, CONFIGURE, DEPENDS, DETAILS, HISTORY, INSTALL: spell created
diff --git a/audio-libs/libifp/INSTALL b/audio-libs/libifp/INSTALL
index d8312de..e6848ba 100755
--- a/audio-libs/libifp/INSTALL
+++ b/audio-libs/libifp/INSTALL
@@ -3,5 +3,5 @@ make install &&
# install the kernel module
if [[ $KERMOD_OPTS == --with-kmodule* ]]; then
- make -C ${INSTALL_ROOT}/usr/src/linux-$(get_kernel_version)
M=${SOURCE_DIRECTORY}/kbuild modules_install
+ make -C ${INSTALL_ROOT}/lib/modules/$(get_kernel_version)/build
M=${SOURCE_DIRECTORY}/kbuild modules_install
fi
diff --git a/kde-apps/kdsl/FINAL b/kde-apps/kdsl/FINAL
index 24688b4..4db8b5c 100755
--- a/kde-apps/kdsl/FINAL
+++ b/kde-apps/kdsl/FINAL
@@ -3,7 +3,7 @@ cat <<EOF
you need to add users to the 'ppp' group in order to use this program
EOF
-if grep -e "CONFIG_PPP is not set" -q /usr/src/linux/.config ;then
+if grep -e "CONFIG_PPP is not set" -q
/lib/modules/$(get_kernel_version)/build/.config ;then
cat <<EOF
you will need to rebuild your kernel with PPP support
diff --git a/kde-apps/kdsl/HISTORY b/kde-apps/kdsl/HISTORY
index 08f4c52..fff603c 100644
--- a/kde-apps/kdsl/HISTORY
+++ b/kde-apps/kdsl/HISTORY
@@ -1,3 +1,6 @@
+2010-04-11 Ismael Luceno <ismael AT sourcemage.org>
+ * FINAL: Fix kernel path
+
2006-06-29 Eric Sandall <sandalle AT sourcemage.org>
* DETAILS: Removed BUILD_API=2, set grimoire-wide