How to cross compile a kernel module?
Aleksandr Rybalko
ray at dlink.ua
Fri Sep 30 09:09:00 UTC 2011
On Thu, 29 Sep 2011 16:29:33 -0700
John-Mark Gurney <jmg at funkthat.com> wrote:
>> Aleksandr Rybalko wrote this message on Thu, Sep 29, 2011 at 13:12
>> +0300:
>> > On Thu, 29 Sep 2011 02:56:09 -0700 (PDT)
>> > satish kondapalli <nitw.satish at gmail.com> wrote:
>> >
>> > >> Thanks Aleksandr,
>> > >> After adding "MODULES_OVERRIDE" option in the kernel config, my
>> > >> module got compiled.
>> > >>
>> > >> But every time while building my module, the entire kernel also
>> > >> compiled. is there any better mechanism to just cross compile
>> > >> the module with out building the entire Kernel.
>> >
>> > To avoid recompile all things - do make KERNFAST=configname kernel.
>> >
>> > Maybe someone also show better way to cross compile one module,
>> > but I don't know.
>>
>> I haven't tested this in a long time, but if you do:
>> make buildenv
>>
>> from the root of your tree, it should setup your path w/ all the
>> necessary cross-tools in your path, etc... Then you can go into the
>> module directory and do a make manually..
Yep, indeed, worked!
SRC=/usr/src
OBJ=/usr/obj
cd ${SRC}
make TARGET=arm TARGET_ARCH=armeb TARGET_CPU=xscale buildenv
# There is check ${PATH} to have toolchain in that dirs
if [ ! -x ${OBJ}/${TARGET}.${TARGET_ARCH}/${SRC}/tmp/usr/bin/cc ]; then
make kernel-toolchain
fi
# Or just do make -DNO_CLEAN kernel-toolchain
cd sys/modules/module/you/need
make
Thank you John-Mark!
>>
>> --
>> John-Mark Gurney Voice: +1 415 225
>> 5579
>>
>> "All that I will do, has been done, All that I have, has not."
--
Alexandr Rybalko <ray at dlink.ua>
aka Alex RAY <ray at ddteam.net>
More information about the freebsd-arm
mailing list