LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 08-24-2011, 12:28 PM   #1
nicolasdiogo
Member
 
Registered: Oct 2003
Location: UK
Distribution: debian lenny x64
Posts: 129

Rep: Reputation: 20
kernel compiliing - howto diminish the number of drivers and modules


hello

i have been reading on how to compile the Kernel (using debian)

such as following this doc:
http://www.howtoforge.com/kernel_com...on_debian_etch


but i would like to find out if there is some technique to allow me to compile only those drivers required by my hardware.

is this a possible scenario? is there a script/program that probes the hardware for requirements to facilitate the compiling?

thanks,


Nicolas
 
Old 08-24-2011, 01:29 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

To get info about hardware you can use:

- lspci possibly using -v,
- lsusb the -v option is also available,
- Have a look at the /var/log/dmesg file,
- The manuals that came with your hardware,
- If you are running Debian: Sysinfo (Applications -> System Tools).

Do make sure you have a working kernel to fall back on!

Hope this helps.

Last edited by druuna; 08-24-2011 at 01:35 PM.
 
Old 08-24-2011, 02:30 PM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,652
Blog Entries: 2

Rep: Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095
Plug in all the hardware that you want to run on that machine and make sure that the drivers are loaded. Then make a new configuration with
Code:
make localmodconfig
, edit it to your needs and compile. After that try if the kernel works with your hardware.
And I second druuna's recommendation to have a working backup kernel.
 
1 members found this post helpful.
Old 08-24-2011, 02:32 PM   #4
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,455

Rep: Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172
You can also look at the output of lsmod to see which modules have been loaded.

Booting up one of those stand-alone CD-ROMs can also be informative since those are "designed to run on anything at all."

The recommendation of always having a known-good kernel at your disposal is, of course, crucial.

You can expect to have some false starts with getting it to work. But you'll be rewarded by a Linux system that can be up-and-running in six seconds flat.
 
Old 08-25-2011, 06:17 AM   #5
nicolasdiogo
Member
 
Registered: Oct 2003
Location: UK
Distribution: debian lenny x64
Posts: 129

Original Poster
Rep: Reputation: 20
Talking

thanks TobiSGD

that is what i was looking for.

since you gave that info - i was also able to find this other nugget from ArchLinux:
https://wiki.archlinux.org/index.php...on_From_Source

Quote:
$ make localmodconfig

Note: for more information about the new build target "localmodconfig" refer to the 2.6.32 release notes.
Note: There is a companion to localmodconfig called localyesconfig. Running it as a make target will convert all modules in the .config into[*] enabled with the net effect being all modules getting hard-coded into the kernel.
there is a lot of good info on ArchLinux wiki - maybe i should run that distro instead of Ubuntu

many thanks,
 
Old 08-25-2011, 10:51 AM   #6
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,652
Blog Entries: 2

Rep: Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095
Quote:
Originally Posted by nicolasdiogo View Post
there is a lot of good info on ArchLinux wiki - maybe i should run that distro instead of Ubuntu
You don't have to change the distro (while Arch is a fine distro), the information on Arch's wiki works for many distros.
 
Old 08-25-2011, 02:01 PM   #7
nicolasdiogo
Member
 
Registered: Oct 2003
Location: UK
Distribution: debian lenny x64
Posts: 129

Original Poster
Rep: Reputation: 20
Thumbs down

Tobi

i am stuck (sorry)

i have compiled the kernel but it is failing to find my network adapter


Code:
04:00.0 Ethernet controller: Atheros Communications Device 1083 (rev c0)
	Subsystem: ASRock Incorporation Device 1083
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0, Cache Line Size: 64 bytes
	Interrupt: pin A routed to IRQ 11
	Region 0: Memory at fe900000 (64-bit, non-prefetchable) [size=256K]
	Region 2: I/O ports at c000 [size=128]
	Capabilities: [40] Power Management version 3
		Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
		Status: D0 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-
	Capabilities: [48] MSI: Enable- Count=1/1 Maskable- 64bit+
		Address: 0000000000000000  Data: 0000
	Capabilities: [58] Express (v1) Endpoint, MSI 00
		DevCap:	MaxPayload 4096 bytes, PhantFunc 0, Latency L0s unlimited, L1 unlimited
			ExtTag- AttnBtn+ AttnInd+ PwrInd+ RBE+ FLReset-
		DevCtl:	Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
			RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
			MaxPayload 128 bytes, MaxReadReq 512 bytes
		DevSta:	CorrErr- UncorrErr+ FatalErr- UnsuppReq+ AuxPwr+ TransPend-
		LnkCap:	Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Latency L0 unlimited, L1 unlimited
			ClockPM+ Surprise- LLActRep- BwNot-
		LnkCtl:	ASPM Disabled; RCB 64 bytes Disabled- Retrain- CommClk+
			ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
		LnkSta:	Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
	Capabilities: [6c] Vital Product Data
pcilib: sysfs_read_vpd: read failed: Connection timed out
		Not readable
	Capabilities: [100 v1] Advanced Error Reporting
		UESta:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq+ ACSViol-
		UEMsk:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
		UESvrt:	DLP- SDES+ TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
		CESta:	RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr-
		CEMsk:	RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
		AERCap:	First Error Pointer: 14, GenCap+ CGenEn- ChkCap+ ChkEn-
	Capabilities: [180 v1] Device Serial Number ff-b6-e0-9d-00-25-22-ff
it was meant to be supported by the kernel that i compiled from sources:
http://www.kernel.org/pub/linux/kern...6.39.4.tar.bz2

any suggestion on how i can fix this?

thanks,
 
Old 08-25-2011, 02:07 PM   #8
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,652
Blog Entries: 2

Rep: Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095Reputation: 4095
After running make localmodconfig run start the menu with make menuconfig, search for your adapter in the network drivers section and enable the driver, then recompile.
I don't have experience with Atheros chips, so that is all I can give as help.
 
Old 08-26-2011, 10:25 AM   #9
nicolasdiogo
Member
 
Registered: Oct 2003
Location: UK
Distribution: debian lenny x64
Posts: 129

Original Poster
Rep: Reputation: 20
apparently all the atheros drivers are set as modules in the kernel 2.6.39.4

Code:
~# cat /boot/config-2.6.39.4-brainpowered-20110825-amd64 | grep -i ather
~# cat /boot/config-2.6.39.4-brainpowered-20110825-amd64 | grep -i atl
CONFIG_ATL2=m
CONFIG_ATL1=m
CONFIG_ATL1E=m
CONFIG_ATL1C=m
CONFIG_INPUT_ATLAS_BTNS=m
but when i compiled kernel 3 the network is fine, and it seems to have the same set of modules/drivers loaded.

Code:
~# cat /boot/config-3.0.3-brainpowered-01 | grep -i ather
~# cat /boot/config-3.0.3-brainpowered-01 | grep -i atl
CONFIG_ATL2=m
CONFIG_ATL1=m
CONFIG_ATL1E=m
CONFIG_ATL1C=m
CONFIG_INPUT_ATLAS_BTNS=m
any suggestion?


thanks,
 
  


Reply

Tags
compiling, kernel, module


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Linux Kernel Modules,Windwos Drivers? HeavenElite Linux - Newbie 6 04-14-2011 08:46 PM
apply patches and kernel compiliing zamurad77 Linux - General 1 08-17-2004 06:52 AM
/lib/modules/.../kernel/drivers empty? maxware Linux - General 7 03-05-2004 08:58 PM
How to keep modules/drivers across kernel recompiles and kernel versions? Pisces107 Linux - General 5 01-21-2004 09:29 PM
After compiling 2.6 kernel >> not enough drivers in /lib/modules?? Jefklak Linux - Software 9 10-21-2003 12:55 PM


All times are GMT -5. The time now is 07:14 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration