build kernel driver without building entire android

189 views
Skip to first unread message

kph

unread,
Jul 20, 2011, 2:50:46 AM7/20/11
to Android-x86, Ton...@ami.com.tw
Dear all,

Although we can build kernel by command

"make kernel TARGET_PRODUCT=generic_x86"

for example, how could we build kernel driver?

I tried command

"make modules TARGET_PRODUCT=generic_x86"

under <android_x86_src>/kernel/, but it seems not following the
android build system.

Is there any way to build kernel drivers without make clean and build
entire android?

Best regards,
Kurt

Kuan Po Huang

unread,
Jul 20, 2011, 3:40:59 AM7/20/11
to Tony Lo[羅金松], Android-x86, AlanTsai(TDI)[蔡文成]
Dear Tony,

I copy android-x86_defconfig to <android_x86_src>/kernel/.config and use command 

    1. "make" 

under <android_x86_src>/kernel/
Now it is building

The difference with command

    2. "make usb_img TARGET_PRODUCT=generic_x86"

under <android_x86_src>/
is that kernel objects of 1. is under kernel dir, 
command 2. will move kernel objects to <android_x86_src>/out/target/product/generic_x86/obj/

For command 1. is there any step needed to make kernel objects copied to <android_x86_src>/out/target/product/generic_x86/obj/?

Thanks.

Kurt

2011/7/20 Tony Lo[羅金松] <Ton...@ami.com.tw>
For linux kernel and driver, you should be able to visit the kernel dir and built. This won't need to build entire Android source.
Message has been deleted

Chih-Wei Huang

unread,
Jul 20, 2011, 11:14:04 AM7/20/11
to andro...@googlegroups.com
First of all, please use English in this mailing list.

Due to the limitation of the android kernel building rules,
if you just change the kernel tree, it won't
trigger to rebuild the kernel image (and modules).

The correct way to trigger the rebuilding is
touch your kernel config
(the file depends which target you use),
or just rm $OUT/kernel.
(not $OUT/obj/kernel as you said, this will
rebuild the whole kernel tree that is unnecessary)

在 2011年7月20日下午10:21,Kuan Po Huang <kph...@gmail.com> 寫道:
> Dear Tony,
> 之前碰到的問題是
> x86 android有支援build kernel的make rules
> 也就是make kernel TARGET_PRODUCT=generic_x86
> 可是這個build kernel的方法不會去build到kernel裡面的所有drivers
> 所以一旦修改rt3070的driver source code想要重編
> 就是要把android整個build好的東西砍掉重編
> 也就是先make clean後
> 再make usb_img TARGET_PRODUCT=generic_x86
> 今天下午我發現一個方法
> 1. remove <android_x86_src>/out/target/product/generic_x86/obj/kernel
> 2. make -j2 usb_img TARGET_PRODUCT=generic_x86
> 這樣build system會誤以為kernel裡面的東西全都沒有編過
> 然後會在2.的時候重編kernel
> 這樣就可以緩解每次改動rt3070 source code的時候
> 必須把整個android砍掉重編的時間
> 只有kernel重編的話大概半小時
> 可是android重編的話大概要一個多小時

--
Chih-Wei
Android-x86 project
http://www.android-x86.org

kph

unread,
Jul 20, 2011, 11:45:03 PM7/20/11
to Android-x86, TonyLo
Dear Chih-Wei,

ok I'll use English in this mailing list and group.

I modify source code and use the two ways.
They both works!

Thanks for your help. :)

Kurt

On 7月20日, 下午11時14分, Chih-Wei Huang <cwhu...@android-x86.org> wrote:
> First of all, please use English in this mailing list.
>
> Due to the limitation of the android kernel building rules,
> if you just change the kernel tree, it won't
> trigger to rebuild the kernel image (and modules).
>
> The correct way to trigger the rebuilding is
> touch your kernel config
> (the file depends which target you use),
> or just rm $OUT/kernel.
> (not $OUT/obj/kernel as you said, this will
> rebuild the whole kernel tree that is unnecessary)
>
Reply all
Reply to author
Forward
0 new messages