Discussion:
Adding custom kernel modules to the build process
(too old to reply)
StefanS
2012-03-05 11:06:24 UTC
Permalink
Dear group,

because some devices may need kernel modules which will never make it into
the mainline kernel (or shouldn't be there anyway), I have developed a
simple solution to add custom (extra) kernel modules.

After much trial and error, here is what I have come up with:
1) attached is a patch for kernel/Android.mk
2) you need to create a directory containing
2a) your kernel module source files
2b) a kernel Makefile containing a list of all source files with .c
replaced by .o, for example if your module has source1.c and source2.c,
write:
----- Makefile -----
obj-m += source1.o source2.o
----- Makefile -----
2c) an Android.mk containing
----- Android.mk ------
LOCAL_PATH := $(my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE := my-custom-kernel-module-name
EXTRA_KERNEL_MODULE_PATH_$(LOCAL_MODULE) := $(LOCAL_PATH)
----- Android.mk ------
(replace my-custom-kernel-module-name with a sensible name for your module,
without whitespaces).
3) add you kernel module (the name you gave if in step 2c) to
AndroidBoard.mk (before the line with "include $(...)"):
----- AndroidBoard.mk ------
[...]
TARGET_EXTRA_KERNEL_MODULES := module1 module2 module3
[...]

As an example, see my github, where I have added three custom kernel
modules: https://github.com/seidler2547/android-x86-ibm-thinkpad-x41t/

Since I'm kind of rubbish with make, feel free to suggest improvements. The
current solution has these advantages:
- simple integration
- modules are built in parallel (with -jX), BUT installed sequentially,
since each modules_install rewrites the modules.dep, and it's not a good
idea to do this in parallel

It is not integrated well with the Android build system, but neither is the
kernel build itself, and for good reasons. So I think this an acceptable
solution.

Stefan
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-x86/-/Pz9W-1JA72MJ.
To post to this group, send email to android-x86-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to android-x86+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/android-x86?hl=en.
rvdb
2012-03-05 11:20:04 UTC
Permalink
Stefan,
Post by StefanS
because some devices may need kernel modules which will never make it into
the mainline kernel (or shouldn't be there anyway)
I know, I can think of one :-)

You probably already would have guessed, that I am going to use this.
Thanks for adding this functionality.

Greetings Rene
Corvus
2012-03-06 07:49:21 UTC
Permalink
Thanks Stefan this will help us...

Corvus
Post by rvdb
Stefan,
Post by StefanS
because some devices may need kernel modules which will never make it into
the mainline kernel (or shouldn't be there anyway)
I know, I can think of one :-)
You probably already would have guessed, that I am going to use this.
Thanks for adding this functionality.
Greetings Rene
StefanS
2012-03-06 08:19:44 UTC
Permalink
Post by rvdb
Stefan,
Post by StefanS
because some devices may need kernel modules which will never make it into
the mainline kernel (or shouldn't be there anyway)
I know, I can think of one :-)
You probably already would have guessed, that I am going to use this.
I thought so :)
Post by rvdb
Thanks for adding this functionality.
Let me know if it works for you, then we can maybe commit this to the repo.

Stefan
rvdb
2012-03-07 10:03:46 UTC
Permalink
Stefan,

So far so good.
First I converted 4 simple modules to use the new setup, no problems.
Then I even converted crystalhd.ko
(driver for Broadcom HD device, it is in kernel staging, but much to
old)
This is a bit more complex (about 7 c sources, one module)
The normal makefile in this directory is also working !
So for me its perfect.

Now all the wetab changes, can be in a device tree, no need for
patching
anything in the android-x86 tree.
I am happy :-)

Greetings Rene
N.B. back to accelerated video playback, using gpu video_overlay.
Post by StefanS
Post by rvdb
Stefan,
Post by StefanS
because some devices may need kernel modules which will never make it into
the mainline kernel (or shouldn't be there anyway)
I know, I can think of one :-)
You probably already would have guessed, that I am going to use this.
I thought so :)
Post by rvdb
Thanks for adding this functionality.
Let me know if it works for you, then we can maybe commit this to the repo.
Stefan
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To post to this group, send email to android-x86-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to android-x86+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-x86?hl=en.
Meerio
2012-03-06 09:15:21 UTC
Permalink
ok, i'm a complete noob, but this means that I can install nvidia
drivers (and broadcom sta) using this process?because nvidia gpus are
not supported yet by android x86..
Post by StefanS
Dear group,
because some devices may need kernel modules which will never make it into
the mainline kernel (or shouldn't be there anyway), I have developed a
simple solution to add custom (extra) kernel modules.
1) attached is a patch for kernel/Android.mk
2) you need to create a directory containing
2a) your kernel module source files
2b) a kernel Makefile containing a list of all source files with .c
replaced by .o, for example if your module has source1.c and source2.c,
----- Makefile -----
obj-m += source1.o source2.o
----- Makefile -----
2c) an Android.mk containing
----- Android.mk ------
LOCAL_PATH := $(my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := my-custom-kernel-module-name
EXTRA_KERNEL_MODULE_PATH_$(LOCAL_MODULE) := $(LOCAL_PATH)
----- Android.mk ------
(replace my-custom-kernel-module-name with a sensible name for your module,
without whitespaces).
3) add you kernel module (the name you gave if in step 2c) to
----- AndroidBoard.mk ------
[...]
TARGET_EXTRA_KERNEL_MODULES := module1 module2 module3
[...]
As an example, see my github, where I have added three custom kernel
modules:https://github.com/seidler2547/android-x86-ibm-thinkpad-x41t/
Since I'm kind of rubbish with make, feel free to suggest improvements. The
 - simple integration
 - modules are built in parallel (with -jX), BUT installed sequentially,
since each modules_install rewrites the modules.dep, and it's not a good
idea to do this in parallel
It is not integrated well with the Android build system, but neither is the
kernel build itself, and for good reasons. So I think this an acceptable
solution.
Stefan
 kmod.patch
1KVisualizzaScarica
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To post to this group, send email to android-x86-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to android-x86+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-x86?hl=en.
StefanS
2012-03-06 09:30:20 UTC
Permalink
Post by Meerio
ok, i'm a complete noob, but this means that I can install nvidia
drivers (and broadcom sta) using this process?because nvidia gpus are
not supported yet by android x86..
GPUs are only partially handled by the kernel, for use in Android you
need the MESA drivers as well, which are a lot more complex.
Broadcom wifi drivers are also already included afaik, so no benefit
there in my opinion.

Stefan
Post by Meerio
Post by StefanS
Dear group,
because some devices may need kernel modules which will never make it into
the mainline kernel (or shouldn't be there anyway), I have developed a
simple solution to add custom (extra) kernel modules.
1) attached is a patch for kernel/Android.mk
2) you need to create a directory containing
2a) your kernel module source files
2b) a kernel Makefile containing a list of all source files with .c
replaced by .o, for example if your module has source1.c and source2.c,
----- Makefile -----
obj-m += source1.o source2.o
----- Makefile -----
2c) an Android.mk containing
----- Android.mk ------
LOCAL_PATH := $(my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := my-custom-kernel-module-name
EXTRA_KERNEL_MODULE_PATH_$(LOCAL_MODULE) := $(LOCAL_PATH)
----- Android.mk ------
(replace my-custom-kernel-module-name with a sensible name for your module,
without whitespaces).
3) add you kernel module (the name you gave if in step 2c) to
----- AndroidBoard.mk ------
[...]
TARGET_EXTRA_KERNEL_MODULES := module1 module2 module3
[...]
As an example, see my github, where I have added three custom kernel
modules:https://github.com/seidler2547/android-x86-ibm-thinkpad-x41t/
Since I'm kind of rubbish with make, feel free to suggest improvements. The
 - simple integration
 - modules are built in parallel (with -jX), BUT installed sequentially,
since each modules_install rewrites the modules.dep, and it's not a good
idea to do this in parallel
It is not integrated well with the Android build system, but neither is the
kernel build itself, and for good reasons. So I think this an acceptable
solution.
Stefan
 kmod.patch
1KVisualizzaScarica
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
For more options, visit this group at http://groups.google.com/group/android-x86?hl=en.
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To post to this group, send email to android-x86-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to android-x86+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-x86?hl=en.
Meerio
2012-03-06 10:13:15 UTC
Permalink
broadcom included drivers don't work.. i modprobe the wl driver,but
when i switch back to the de It conflicts with video rom..(this
computer sucks)
by the way thanks for the explanation!:)
Post by StefanS
Post by Meerio
ok, i'm a complete noob, but this means that I can install nvidia
drivers (and broadcom sta) using this process?because nvidia gpus are
not supported yet by android x86..
GPUs are only partially handled by the kernel, for use in Android you
need the MESA drivers as well, which are a lot more complex.
Broadcom wifi drivers are also already included afaik, so no benefit
there in my opinion.
Stefan
Post by Meerio
Post by StefanS
Dear group,
because some devices may need kernel modules which will never make it into
the mainline kernel (or shouldn't be there anyway), I have developed a
simple solution to add custom (extra) kernel modules.
1) attached is a patch for kernel/Android.mk
2) you need to create a directory containing
2a) your kernel module source files
2b) a kernel Makefile containing a list of all source files with .c
replaced by .o, for example if your module has source1.c and source2.c,
----- Makefile -----
obj-m += source1.o source2.o
----- Makefile -----
2c) an Android.mk containing
----- Android.mk ------
LOCAL_PATH := $(my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := my-custom-kernel-module-name
EXTRA_KERNEL_MODULE_PATH_$(LOCAL_MODULE) := $(LOCAL_PATH)
----- Android.mk ------
(replace my-custom-kernel-module-name with a sensible name for your module,
without whitespaces).
3) add you kernel module (the name you gave if in step 2c) to
----- AndroidBoard.mk ------
[...]
TARGET_EXTRA_KERNEL_MODULES := module1 module2 module3
[...]
As an example, see my github, where I have added three custom kernel
modules:https://github.com/seidler2547/android-x86-ibm-thinkpad-x41t/
Since I'm kind of rubbish with make, feel free to suggest improvements. The
 - simple integration
 - modules are built in parallel (with -jX), BUT installed sequentially,
since each modules_install rewrites the modules.dep, and it's not a good
idea to do this in parallel
It is not integrated well with the Android build system, but neither is the
kernel build itself, and for good reasons. So I think this an acceptable
solution.
Stefan
 kmod.patch
1KVisualizzaScarica
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
For more options, visit this group athttp://groups.google.com/group/android-x86?hl=en.
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To post to this group, send email to android-x86-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to android-x86+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-x86?hl=en.
Chih-Wei Huang
2012-03-09 16:25:13 UTC
Permalink
Personally I think it's not a good idea to
build an out-of-tree kernel module.
Anyway, the patch seems to be harmless
and useful to someone. So let's do it.
Post by StefanS
Dear group,
because some devices may need kernel modules which will never make it into
the mainline kernel (or shouldn't be there anyway), I have developed a
simple solution to add custom (extra) kernel modules.
1) attached is a patch for kernel/Android.mk
2) you need to create a directory containing
2a) your kernel module source files
2b) a kernel Makefile containing a list of all source files with .c replaced
----- Makefile -----
obj-m += source1.o source2.o
----- Makefile -----
2c) an Android.mk containing
----- Android.mk ------
LOCAL_PATH := $(my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := my-custom-kernel-module-name
EXTRA_KERNEL_MODULE_PATH_$(LOCAL_MODULE) := $(LOCAL_PATH)
----- Android.mk ------
(replace my-custom-kernel-module-name with a sensible name for your module,
without whitespaces).
3) add you kernel module (the name you gave if in step 2c) to
----- AndroidBoard.mk ------
--
Chih-Wei
Android-x86 project
http://www.android-x86.org
Rishi Ranjan
2014-11-25 22:43:53 UTC
Permalink
I tried adding virtualbox guest additions as per the instruction. I see
that obj/vboxguest.kmodule/ is created but my module does not get added
to ls system/lib/modules/3.10.58-android-x86+/extra/.


I am looking at build/core/tasks/kernel.mk to see why it was not created.

Can someone help me to figure out what I am doing wrong?
I would like to add to this for anybody who's not *that* familiar with
compiling on linux themselves and who would like to make use of this
1. You should add the kernel module folder to
/device/<brand>/<product>/<folder here> of the source tree. Let's take an
example from android-x86.org, if you would be compiling for the eeepc
$ make iso_img TARGET_PRODUCT=eeepc
/device/asus/eeepc/<your module dir>
The AndroidBoard.mk file that needs adjusting is in there as well.
2. Don't blindly check the kernel module folder's contents for files
ending in *.c and add them to the Makefile as *.o. Better is to check the
original Makefile to find out which objects it generates (i.e. the original obj-m
variable) since some of the *.c files are merely includes for the module.
I found it a bit ambiguous / confusing in the original post ;-)
Cheers,
mlc.
Post by StefanS
Dear group,
because some devices may need kernel modules which will never make it
into the mainline kernel (or shouldn't be there anyway), I have developed a
simple solution to add custom (extra) kernel modules.
1) attached is a patch for kernel/Android.mk
2) you need to create a directory containing
2a) your kernel module source files
2b) a kernel Makefile containing a list of all source files with .c
replaced by .o, for example if your module has source1.c and source2.c,
----- Makefile -----
obj-m += source1.o source2.o
----- Makefile -----
2c) an Android.mk containing
----- Android.mk ------
LOCAL_PATH := $(my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := my-custom-kernel-module-name
EXTRA_KERNEL_MODULE_PATH_$(LOCAL_MODULE) := $(LOCAL_PATH)
----- Android.mk ------
(replace my-custom-kernel-module-name with a sensible name for your
module, without whitespaces).
3) add you kernel module (the name you gave if in step 2c) to
----- AndroidBoard.mk ------
[...]
TARGET_EXTRA_KERNEL_MODULES := module1 module2 module3
[...]
As an example, see my github, where I have added three custom kernel
modules: https://github.com/seidler2547/android-x86-ibm-thinkpad-x41t/
Since I'm kind of rubbish with make, feel free to suggest improvements.
- simple integration
- modules are built in parallel (with -jX), BUT installed sequentially,
since each modules_install rewrites the modules.dep, and it's not a good
idea to do this in parallel
It is not integrated well with the Android build system, but neither is
the kernel build itself, and for good reasons. So I think this an
acceptable solution.
Stefan
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at http://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.
Rishi Ranjan
2014-11-26 00:08:36 UTC
Permalink
Please ignore my last comment. There was a issue with my Include path. I am
recompiling it.
Post by Rishi Ranjan
I tried adding virtualbox guest additions as per the instruction. I see
that obj/vboxguest.kmodule/ is created but my module does not get added
to ls system/lib/modules/3.10.58-android-x86+/extra/.
I am looking at build/core/tasks/kernel.mk to see why it was not created.
Can someone help me to figure out what I am doing wrong?
I would like to add to this for anybody who's not *that* familiar with
compiling on linux themselves and who would like to make use of this
1. You should add the kernel module folder to
/device/<brand>/<product>/<folder here> of the source tree. Let's take an
example from android-x86.org, if you would be compiling for the eeepc
$ make iso_img TARGET_PRODUCT=eeepc
/device/asus/eeepc/<your module dir>
The AndroidBoard.mk file that needs adjusting is in there as well.
2. Don't blindly check the kernel module folder's contents for files
ending in *.c and add them to the Makefile as *.o. Better is to check the
original Makefile to find out which objects it generates (i.e. the original obj-m
variable) since some of the *.c files are merely includes for the module.
I found it a bit ambiguous / confusing in the original post ;-)
Cheers,
mlc.
Post by StefanS
Dear group,
because some devices may need kernel modules which will never make it
into the mainline kernel (or shouldn't be there anyway), I have developed a
simple solution to add custom (extra) kernel modules.
1) attached is a patch for kernel/Android.mk
2) you need to create a directory containing
2a) your kernel module source files
2b) a kernel Makefile containing a list of all source files with .c
replaced by .o, for example if your module has source1.c and source2.c,
----- Makefile -----
obj-m += source1.o source2.o
----- Makefile -----
2c) an Android.mk containing
----- Android.mk ------
LOCAL_PATH := $(my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := my-custom-kernel-module-name
EXTRA_KERNEL_MODULE_PATH_$(LOCAL_MODULE) := $(LOCAL_PATH)
----- Android.mk ------
(replace my-custom-kernel-module-name with a sensible name for your
module, without whitespaces).
3) add you kernel module (the name you gave if in step 2c) to
----- AndroidBoard.mk ------
[...]
TARGET_EXTRA_KERNEL_MODULES := module1 module2 module3
[...]
As an example, see my github, where I have added three custom kernel
modules: https://github.com/seidler2547/android-x86-ibm-thinkpad-x41t/
Since I'm kind of rubbish with make, feel free to suggest improvements.
- simple integration
- modules are built in parallel (with -jX), BUT installed sequentially,
since each modules_install rewrites the modules.dep, and it's not a good
idea to do this in parallel
It is not integrated well with the Android build system, but neither is
the kernel build itself, and for good reasons. So I think this an
acceptable solution.
Stefan
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at http://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.
Rishi Ranjan
2014-11-26 04:20:50 UTC
Permalink
The thing that worked for me was to leave the Makefile in Kbuild format. So
instead of "obj-m += source1.o source2.o", I added my .o files in format
"obj-y += source1.o source2.o".
Post by Rishi Ranjan
Please ignore my last comment. There was a issue with my Include path. I
am recompiling it.
Post by Rishi Ranjan
I tried adding virtualbox guest additions as per the instruction. I see
that obj/vboxguest.kmodule/ is created but my module does not get added
to ls system/lib/modules/3.10.58-android-x86+/extra/.
I am looking at build/core/tasks/kernel.mk to see why it was not created.
Can someone help me to figure out what I am doing wrong?
I would like to add to this for anybody who's not *that* familiar with
compiling on linux themselves and who would like to make use of this
1. You should add the kernel module folder to
/device/<brand>/<product>/<folder here> of the source tree. Let's take an
example from android-x86.org, if you would be compiling for the eeepc
$ make iso_img TARGET_PRODUCT=eeepc
/device/asus/eeepc/<your module dir>
The AndroidBoard.mk file that needs adjusting is in there as well.
2. Don't blindly check the kernel module folder's contents for files
ending in *.c and add them to the Makefile as *.o. Better is to check the
original Makefile to find out which objects it generates (i.e. the original obj-m
variable) since some of the *.c files are merely includes for the module.
I found it a bit ambiguous / confusing in the original post ;-)
Cheers,
mlc.
Post by StefanS
Dear group,
because some devices may need kernel modules which will never make it
into the mainline kernel (or shouldn't be there anyway), I have developed a
simple solution to add custom (extra) kernel modules.
1) attached is a patch for kernel/Android.mk
2) you need to create a directory containing
2a) your kernel module source files
2b) a kernel Makefile containing a list of all source files with .c
replaced by .o, for example if your module has source1.c and source2.c,
----- Makefile -----
obj-m += source1.o source2.o
----- Makefile -----
2c) an Android.mk containing
----- Android.mk ------
LOCAL_PATH := $(my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := my-custom-kernel-module-name
EXTRA_KERNEL_MODULE_PATH_$(LOCAL_MODULE) := $(LOCAL_PATH)
----- Android.mk ------
(replace my-custom-kernel-module-name with a sensible name for your
module, without whitespaces).
3) add you kernel module (the name you gave if in step 2c) to
----- AndroidBoard.mk ------
[...]
TARGET_EXTRA_KERNEL_MODULES := module1 module2 module3
[...]
As an example, see my github, where I have added three custom kernel
modules: https://github.com/seidler2547/android-x86-ibm-thinkpad-x41t/
Since I'm kind of rubbish with make, feel free to suggest improvements.
- simple integration
- modules are built in parallel (with -jX), BUT installed
sequentially, since each modules_install rewrites the modules.dep, and it's
not a good idea to do this in parallel
It is not integrated well with the Android build system, but neither is
the kernel build itself, and for good reasons. So I think this an
acceptable solution.
Stefan
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at http://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.
Rishi Ranjan
2014-11-27 04:52:46 UTC
Permalink
vbox guest additions help in things like creating a shared folder from host
PC, using the GPU of host PC by guest etc.

I am using it to install the system applications on guest so that I can
pass parameters between guest and host.

I think there are following issues with integrating guest additions with
androidx86 code base:

1. Guest additions are tightly coupled with Virtualbox release. So to
integrate the additions with code base, there has to be a configuration
parameter to specify the virtualbox version and the code has to be pulled
in at compile time.
2. The virtualbox code is distributed under GPL license so not sure if it
can be added to androidx86 code base.

Thanks,
Rishi
What benefit can we get by adding the vbox guest additions?
If it's useful, we can integrate it into the codebase.
Thanks!
Post by Rishi Ranjan
The thing that worked for me was to leave the Makefile in Kbuild format.
So
Post by Rishi Ranjan
instead of "obj-m += source1.o source2.o", I added my .o files in format
"obj-y += source1.o source2.o".
Post by Rishi Ranjan
Please ignore my last comment. There was a issue with my Include path.
I
Post by Rishi Ranjan
Post by Rishi Ranjan
am recompiling it.
Post by Rishi Ranjan
I tried adding virtualbox guest additions as per the instruction. I
see
Post by Rishi Ranjan
Post by Rishi Ranjan
Post by Rishi Ranjan
that obj/vboxguest.kmodule/ is created but my module does not get
added to
Post by Rishi Ranjan
Post by Rishi Ranjan
Post by Rishi Ranjan
ls system/lib/modules/3.10.58-android-x86+/extra/.
I am looking at build/core/tasks/kernel.mk to see why it was not
created.
Post by Rishi Ranjan
Post by Rishi Ranjan
Post by Rishi Ranjan
Can someone help me to figure out what I am doing wrong?
I would like to add to this for anybody who's not that familiar with
compiling on linux themselves and who would like to make use of this
handy
Post by Rishi Ranjan
Post by Rishi Ranjan
Post by Rishi Ranjan
1. You should add the kernel module folder to
/device/<brand>/<product>/<folder here> of the source tree. Let's
take an
Post by Rishi Ranjan
Post by Rishi Ranjan
Post by Rishi Ranjan
example from android-x86.org, if you would be compiling for the
eeepc
Post by Rishi Ranjan
Post by Rishi Ranjan
Post by Rishi Ranjan
$ make iso_img TARGET_PRODUCT=eeepc
/device/asus/eeepc/<your module dir>
The AndroidBoard.mk file that needs adjusting is in there as well.
2. Don't blindly check the kernel module folder's contents for files
ending in *.c and add them to the Makefile as *.o. Better is to check
the
Post by Rishi Ranjan
Post by Rishi Ranjan
Post by Rishi Ranjan
original Makefile to find out which objects it generates (i.e. the
original
Post by Rishi Ranjan
Post by Rishi Ranjan
Post by Rishi Ranjan
obj-m variable) since some of the *.c files are merely includes for
the
Post by Rishi Ranjan
Post by Rishi Ranjan
Post by Rishi Ranjan
module.
I found it a bit ambiguous / confusing in the original post ;-)
Cheers,
mlc.
Post by StefanS
Dear group,
because some devices may need kernel modules which will never make
it
Post by Rishi Ranjan
Post by Rishi Ranjan
Post by Rishi Ranjan
Post by StefanS
into the mainline kernel (or shouldn't be there anyway), I have
developed a
Post by Rishi Ranjan
Post by Rishi Ranjan
Post by Rishi Ranjan
Post by StefanS
simple solution to add custom (extra) kernel modules.
1) attached is a patch for kernel/Android.mk
2) you need to create a directory containing
2a) your kernel module source files
2b) a kernel Makefile containing a list of all source files with .c
replaced by .o, for example if your module has source1.c and
source2.c,
Post by Rishi Ranjan
Post by Rishi Ranjan
Post by Rishi Ranjan
Post by StefanS
----- Makefile -----
obj-m += source1.o source2.o
----- Makefile -----
2c) an Android.mk containing
----- Android.mk ------
LOCAL_PATH := $(my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := my-custom-kernel-module-name
EXTRA_KERNEL_MODULE_PATH_$(LOCAL_MODULE) := $(LOCAL_PATH)
----- Android.mk ------
(replace my-custom-kernel-module-name with a sensible name for your
module, without whitespaces).
3) add you kernel module (the name you gave if in step 2c) to
----- AndroidBoard.mk ------
[...]
TARGET_EXTRA_KERNEL_MODULES := module1 module2 module3
[...]
As an example, see my github, where I have added three custom kernel
https://github.com/seidler2547/android-x86-ibm-thinkpad-x41t/
Post by Rishi Ranjan
Post by Rishi Ranjan
Post by Rishi Ranjan
Post by StefanS
Since I'm kind of rubbish with make, feel free to suggest
improvements.
Post by Rishi Ranjan
Post by Rishi Ranjan
Post by Rishi Ranjan
Post by StefanS
- simple integration
- modules are built in parallel (with -jX), BUT installed
sequentially, since each modules_install rewrites the modules.dep,
and it's
Post by Rishi Ranjan
Post by Rishi Ranjan
Post by Rishi Ranjan
Post by StefanS
not a good idea to do this in parallel
It is not integrated well with the Android build system, but neither
is
Post by Rishi Ranjan
Post by Rishi Ranjan
Post by Rishi Ranjan
Post by StefanS
the kernel build itself, and for good reasons. So I think this an
acceptable
Post by Rishi Ranjan
Post by Rishi Ranjan
Post by Rishi Ranjan
Post by StefanS
solution.
Stefan
--
You received this message because you are subscribed to the Google
Groups
Post by Rishi Ranjan
"Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send
an
<javascript:>.
Post by Rishi Ranjan
Visit this group at http://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.
--
Chih-Wei
Android-x86 project
http://www.android-x86.org
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at http://groups.google.com/group/android-x86.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...