LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 02-02-2015, 08:32 AM   #1
bogdanul2003
LQ Newbie
 
Registered: Feb 2015
Posts: 5

Rep: Reputation: Disabled
How to add extra dependencies to kernel modules


I'm trying to add fbtft kernel module as an external package in openwrt by copying all necessary files in /package/fbtft directory like this guy did https://github.com/GBert/openwrt-misc/tree/master/fbtft

The problem is that fbtft is compiled using -DCONFIG_FB_DEFERRED_IO=1 . This define is used by some framebuffer structures like fb_info from fb.h. If CONFIG_FB_DEFERRED_IO is defined then the structure has a different size. Now linux frame buffer files like fbsysfs.c, which uses this fb_info strucure, are not compiled with this CONFIG_FB_DEFERRED_IO flag which causes fb_info to have a different size. Fbtft uses fbsysfs.c to allocate memory for fb_info structure but the size is different between the two because they are not compiled with the same flags.

I tried to add FB_BROADSHEET and FB_AUO_K190X (which depend on FB_DEFERRED_IO) from "make kernel_menuconfig" but fbsysfs.c and other framebuffer files are still not compiled with the required flag (i can see this by looking at .fbsysfs.o.cmd file). How can I add -DCONFIG_FB_DEFERRED_IO=1 flag at compile time for all linux framebuffer files so they all have the correct fb_info structure ?

Thanks
 
Old 02-02-2015, 08:47 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,138

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
Edit the .config file in the root of the kernel source. Change
Code:
# CONFIG_FB_DEFERRED_IO is not set
to
Code:
CONFIG_FB_DEFERRED_IO=y
then recompile the kernel.
 
Old 02-02-2015, 09:11 AM   #3
bogdanul2003
LQ Newbie
 
Registered: Feb 2015
Posts: 5

Original Poster
Rep: Reputation: Disabled
I've attached the .config (renamed to config.txt) and the .o.cmd file after compilation.
It seems CONFIG_FB_DEFERRED_IO is set to y but if you look at the .o.cmd file you'll see that fbsysfs.c was not compiled with -DCONFIG_FB_DEFERRED_IO=1.
After I modified the .config file I ran make V=s in the root of openwrt source tree so I compiled not only the kernel.

Shouldn't I modify framebuffer Makefile and manually add -DCONFIG_FB_DEFERRED_IO=1 ?
Attached Files
File Type: txt config.txt (66.4 KB, 19 views)
File Type: txt fbsysfs.o.cmd.txt (40.1 KB, 29 views)
 
Old 02-02-2015, 10:41 AM   #4
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,138

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
If your build tools are not including .config in the compilation, then most modules will not work.
 
Old 02-02-2015, 11:43 AM   #5
bogdanul2003
LQ Newbie
 
Registered: Feb 2015
Posts: 5

Original Poster
Rep: Reputation: Disabled
How can I know for sure if the .config file is used by the build tools ?
 
Old 02-03-2015, 02:42 AM   #6
bogdanul2003
LQ Newbie
 
Registered: Feb 2015
Posts: 5

Original Poster
Rep: Reputation: Disabled
One more question: if CONFIG_FB_DEFERRED_IO=y in .config file all files should be compiled with -DCONFIG_FB_DEFERRED_IO=1 ? How does the build tool choose what files are compiled with what define flags ?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] building dependencies for kernel modules in cross compiling environment ayyasprings Linux - Embedded & Single-board computer 4 08-08-2014 02:57 AM
[SOLVED] Recompiling kernel required to add modules? littlebigman Linux - Software 2 01-05-2011 11:57 AM
how to add 'modules' without re-compiling the kernel b0nd Linux - Newbie 4 10-03-2005 10:22 AM
Compile Error- /lib/modules/extra/modules.dep UpChuck Debian 2 01-11-2004 10:20 AM
Slack9 - no PPP (can't open dependencies file /lib/modules/2.4.18/modules.dep) bluehz Slackware 1 05-04-2003 02:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 08:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration