LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   kernel compiliing - howto diminish the number of drivers and modules (https://www.linuxquestions.org/questions/linux-software-2/kernel-compiliing-howto-diminish-the-number-of-drivers-and-modules-899208/)

nicolasdiogo 08-24-2011 11:28 AM

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

druuna 08-24-2011 12:29 PM

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.

TobiSGD 08-24-2011 01:30 PM

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.

sundialsvcs 08-24-2011 01:32 PM

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. :eek:

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.

nicolasdiogo 08-25-2011 05:17 AM

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,

TobiSGD 08-25-2011 09:51 AM

Quote:

Originally Posted by nicolasdiogo (Post 4452951)
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.

nicolasdiogo 08-25-2011 01:01 PM

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,

TobiSGD 08-25-2011 01:07 PM

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.

nicolasdiogo 08-26-2011 09:25 AM

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,


All times are GMT -5. The time now is 06:38 AM.