Build custome kernel with custom modules (module is opencv -latest)


Hi All,

I like to thank you all for resolving my last query.
@danielt @Mani @ndec

but I have new question now , I wanted to build custom kernel without gui and only opencv (latest) compiled with kernel and after that only one imgae (for production purpose) that contains the opencv modules which I Required on board with kernel ( with out needing of gui, only CLI. and other non required modules).

In normal linux we can do that, I have tried to do with linaro arm gcc toolchain and followed steps

But I am unsuccessful,
Can any body point me to correct direction here.




your last post is not very clear, i don’t understand the problem you are facing. Can you please provide more details about the actual issue?


Hi @ndec,

Thank you for the replay.
I am using debian as source.

I wanted :-

  1. Build custom kernel to flash on dragon board, (without gui and other stuff,as not required)
  2. integrating my modules with above kernel to make one execution.

I went through the link above and was not able to build.

So can you provide a way or point me to that direction to achieve my requirements.




Looking at the wiki with instructions, it looks ok to me. and it should work, so let’s try to understand what it doesn’t work for you… can you provide detailed instructions of what you’ve done , what failed and how?

For now, let’s make sure that you can rebuild the same thing that we released, so do not make any local change, just build our vanilla kernel


I’d strongly advise that when you can’t get something to build always share the build logs in the first post. Help will arrive much faster that way. I’d recommending using a pastebin or github gist to hold them (although you can also wrap them with [details] tag like the one below):

Build log
This is an example build log.

To make it I wrapped it in a details tag:

[details=A summary of what it contains]
Stuff goes here (ideally as preformatted text using the button in the editor)


Hi @danielt, @ndec

Thanks for Suggestion.:slight_smile:
and I am also aware of the tools for pasting logs.

I will paste logs in some time(right now I am not near the system where I did setup).
Kindly need your help and also suggestions, If this is right way to go on.

My aim here is I Only need opencv to run my program with less delay.
From a prev. thread I was able to install opencv(3.4.0) but when I ran simple program of
object detection from video, I got delay of 300 milliseconds . ( i was printing time stamps to check) That was ‘slow’ for processing.

So I Thought to remove gui other ‘not required’ software and just to have compiler for opencv and opencv libs.

Also I highly admire your suggestions, as what I think is right solution?

Thank you very much


To some extent it depends whether your use case is RAM limited (e.g. swapping to handle the workload) or CPU limited (e.g. A53 takes a long time to process a frame). Even a simply tool like top should give you clues about what is the limiting factor.

Generally speaking minimal images can have a big impact on boot time and on RAM usage… but their impact on post-boot CPU performance is much less significant (most services just sleep after boot waiting to be asked to do something… even if they consume RAM they can often swap out without hurting performance too much).

It is worth stopping the graphics server but if you adopt the -developer images then this should already be the case (just to double check… you are using the -developer image rather than the -alip image, right?).



I was using alip, But I have developer tried as well. And in that also there minimal gui based on ‘qt’ is there.
In top I have seen the usage while the application is running and its 98-99%.

And this is simple application like ‘hello world’ for opencv. ( I am aware that opencv internally uses many libs that also calls many functions, As I have checked with ‘ps’ command and seen in ‘top’.)

So, As i understand this may be cpu hungry, so will it be of any use to do the kernel customization?


Are you 100% sure. Its a long time since I used the -developer image but there is no xserver and no qt in the list of included packages:

This is probably CPU bound but you should also confirm the split of CPU activity at the top of the window (user, system, idle, waiting, etc). If the user figure (the time the CPU spends running userspace code) is high then you are CPU bound.

We’re working in rough figures here but if your app already gets 98% of whatever CPU it runs on then kernel size tuning is unlikely to yield much (how could it yield more than 2%?).

How many times does your app appear in top (are you using all four CPUs in your test case or are you running single threaded)?



Thank you for the link, That I have actually checked. Yes I have developer, but Lastly I flashed alip on board while installing opencv for internet support. (though here is libx11 is also there which provides graphical interface. but its not the issue here .:slight_smile: )

while running top command, I have seen my application which consumes 98% to 99% ( not other system process, it’s surprise that simple opencv application creates 4-5 threads, the main thread takes huge cpu amount).
Let me try with developer image again,.

But Aim is to install only opencv without other things, (non-required packages at time,)and have single kernel to work on.


I’m afraid your description of what you see in top isn’t 100% clear but
it sounds to me like you could gain far more performance if you can
figure out how to spread the work across 4 CPUs than you could gain by
tuning the kernel, although I’m afraid I don’t enough about OpenCV to
help with that.

It’s fine if you want to tune the kernel but there is very little
evidence that doing so will make things much faster.



Ok, Let me try, and work it out.

and mean while I will post logs for the errors I receive.