Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 25279 Details for
Bug 32737
Compiling external kernel modules with 2.6 kernels
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to kernel-mod.eclass dubbed "Have My Cake and Eat it Too"
kernel-mod-KV_OUTPUT-v4.diff (text/plain), 3.72 KB, created by
Peter Johanson (RETIRED)
on 2004-02-09 11:32:20 UTC
(
hide
)
Description:
Patch to kernel-mod.eclass dubbed "Have My Cake and Eat it Too"
Filename:
MIME Type:
Creator:
Peter Johanson (RETIRED)
Created:
2004-02-09 11:32:20 UTC
Size:
3.72 KB
patch
obsolete
>--- kernel-mod.eclass.bak 2004-01-15 10:13:46.000000000 -0500 >+++ kernel-mod.eclass 2004-02-09 14:28:48.313276672 -0500 >@@ -8,6 +8,15 @@ > # This eclass differs from kmod.eclass because it doesn't require modules > # to be added to the kernel source tree first. > >+# Variables you can use to change behavior >+# >+# KERNEL_MOD_SOURCES - space seperated list of source to unpack in kernel-mod_src_unpack() >+# if you don't want ${A} unpacked >+# KERNEL_MOD_KOUTPUT_PATCH - Patch to apply in src_unpack() if a seperate output directory >+# is detected >+# KERNEL_MOD_NORMAL26_PATCH - Patch to fix 2.6 compilation if KV_OUTPUT is /usr/src/linux >+# 2.6 kernel. >+ > ECLASS=kernel-mod > INHERITED="$INHERITED $ECLASS" > S=${WORKDIR}/${P} >@@ -16,6 +25,12 @@ > SRC_URI="${SRC_URI:-unknown - please fix me!!}" > KERNEL_DIR="${KERNEL_DIR:-/usr/src/linux}" > >+# KERNEL_MOD_SOURCES is used if you don't want to unpack just ${A} >+if [ -z "${KERNEL_MOD_SOURCES}" ] >+then >+ KERNEL_MOD_SOURCES=${A} >+fi >+ > kernel-mod_getmakefilevar () > { > grep $1 $2 | head -n 1 | cut -d = -f 2- | awk '{ print $1 }' >@@ -61,6 +76,13 @@ > > KV_MK_VERSION_FULL="$KV_MK_MAJOR.$KV_MK_MINOR.$KV_MK_PATCH$KV_MK_TYPE" > >+ KV_MK_OUTPUT="`kernel-mod_getmakefilevar ^KBUILD_OUTPUT $KV_MK_FILE`" >+ >+ # Fix for if we found the default KBUILD_OUTPUT instead of a set one >+ if [ "${KV_MK_OUTPUT}" = "\$(shell" ]; then >+ KV_MK_OUTPUT="" >+ fi >+ > if [ "$KV_MK_VERSION_FULL" != "$KV_DIR_VERSION_FULL" ]; then > ewarn > ewarn "The kernel Makefile says that this is a $KV_MK_VERSION_FULL kernel" >@@ -82,7 +104,43 @@ > KV_PATCH="$KV_MK_PATCH" > KV_TYPE="$KV_MK_TYPE" > >+ # if we found an output location, use that. otherwise use KERNEL_DIR. >+ if [ ! -z "${KV_MK_OUTPUT}" ] >+ then >+ einfo "Setting to MK_OUTPUT" >+ KV_OUTPUT="$KV_MK_OUTPUT" >+ else >+ einfo "Setting to KERNEL_DIR" >+ KV_OUTPUT="$KERNEL_DIR" >+ fi >+ >+ if [ "${KV_MINOR}" -gt "4" ] >+ then >+ KV_OBJ="ko" >+ else >+ KV_OBJ="o" >+ fi >+ >+ if [ "${KV_MINOR}" -gt 4 ] && [ "${KV_OUTPUT}" = "/usr/src/linux" ] >+ then >+ KV_BUILD="${S}/kernel-build" >+ else >+ KV_BUILD="/usr/src/linux" >+ fi >+ > einfo "Building for Linux ${KV_VERSION_FULL} found in ${KERNEL_DIR}" >+ >+ if [ "${KV_MINOR}" -gt "4" ] >+ then >+ einfo "which outputs to ${KV_OUTPUT}" >+ >+ # Warn them if they aren't using a different output directory >+ if [ "${KV_OUTPUT}" = "/usr/src/linux" ]; then >+ ewarn "By not using the kernel's ability to output to an alternative" >+ ewarn "directory, some external module builds may fail." >+ ewarn "See <insert link to user doc here>" >+ fi >+ fi > } > > kernel-mod_checkzlibinflate_configured () >@@ -151,11 +209,48 @@ > die "Kernel doesn't include zlib support" > } > >+kernel-mod_src_unpack () >+{ >+ check_KV >+ kernel-mod_getversion >+ unpack ${KERNEL_MOD_SOURCES} >+ if [ "${KV_MINOR}" -gt 4 ] >+ then >+ cd ${S} >+ if [ "${KV_OUTPUT}" = "/usr/src/linux" ]; then >+ # Setup our build directory >+ einfo "Creating temporary build directory in ${KV_BUILD} using files in ${KV_OUTPUT}" >+ mkdir -p ${KV_BUILD} >+ cd ${KV_BUILD} >+ for link in ${KV_OUTPUT}/.config \ >+ ${KV_OUTPUT}/.version \ >+ ${KV_OUTPUT}/*; >+ do >+ ln -s "${link}" . >+ done >+ >+ # Patch as needed >+ if [ -n "${KERNEL_MOD_NORMAL26_PATCH}" ]; then >+ einfo "Patching to fix 2.6 module compilation" >+ epatch "${KERNEL_MOD_NORMAL26_PATCH}" >+ fi >+ elif [ -n "${KERNEL_MOD_KOUTPUT_PATCH}" ]; then >+ einfo "Patching to enable koutput compatibility" >+ epatch ${KERNEL_MOD_KOUTPUT_PATCH} >+ fi >+ fi >+} >+ > kernel-mod_src_compile () > { > emake KERNEL_DIR=${KERNEL_DIR} || die > } > >+kernel-mod_pkg_postinst() >+{ >+ depmod -a >+} >+ > kernel-mod_is_2_4_kernel() { > kernel-mod_getversion > >@@ -189,4 +284,4 @@ > fi > } > >-EXPORT_FUNCTIONS src_compile >+EXPORT_FUNCTIONS src_unpack src_compile pkg_postinst
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 32737
:
23927
|
24094
|
24095
|
24096
|
24131
|
24646
|
24647
|
24649
|
24650
|
24651
|
25235
|
25237
|
25238
|
25239
|
25279
|
25280
|
25281
|
25282
|
25283
|
25363
|
25453
|
25454
|
25497
|
26588
|
26635
|
26643
|
27538
|
30030
|
31314
|
31315
|
31317
|
31345
|
31346
|
31347
|
32935
|
33123
|
33124
|
33125
|
33356
|
36615