You are not logged in.
Pages: 1
Hi , i am reading the book "Linux kernel in a Nutshell" http://oreilly.com/catalog/9780596100797/
and i am at chaper 7 where you must create a .config optimized for your hardware. After i get a list
with all the modules my computer needs i have to find in the .config the line that configures that driver
but the method to find that line is not working:
first i cd in my linux source
$ cd ~/linux/src/linux-2.6.28-ARCH/
then i search for a module
$ find -type f -name Makefile | grep e1000
I get no output. I opened the Makefile and is not containing the modules config in it.
Maybe the kernel structure changed or i am doing something wrong?
I also tried this script http://lkml.org/lkml/2008/9/18/203 ,after changing the /sbin/lsmod to /bin/lsmod
but it sais that it can't find the configuration for the modules.
Found an intresting thread but ui do not know how to get the script from Chris Li, maybe someone can find it.
Last edited by simion314 (2009-02-11 04:27:45)
Offline
cd /usr/src/linux-2.6.28-ARCH/
cat .config | grep E1000
CONFIG_E1000=m
CONFIG_E1000E=m
Offline
cd /usr/src/linux-2.6.28-ARCH/
cat .config | grep E1000
CONFIG_E1000=m
CONFIG_E1000E=m
This method will not work in all cases and you will have modules that you can't find the CONFIG_. The best method is using the kernel MAKEfile and it's tools,, i just found this(but i am unable to find how to get the scripts) http://kerneltrap.org/index.php?q=maila … 124/thread
Thx for the response.
Offline
i just found this(but i am unable to find how to get the scripts) http://kerneltrap.org/index.php?q=maila … 124/thread
Really interesting! I tried a year ago to write a bash script doing something similar. Basically it compared the loaded modules reported by lsmod to all ".ko" files built. Modules not loaded were reported and could be manually disabled...
Offline
I could not find the python script either.
I just found back my stupid script. Here it is:
#!/bin/bash
# Save loaded module
lsmod |sort | awk '{ print $1 }' > /tmp/driver_loaded.txt
# Find compiled modules
find /lib/modules/`uname -r`/ -name *.ko | xargs -r -i basename "{}" | sed -e "s/.ko//g" | sort > /tmp/driver_compiled.txt
# Compare the two list, and print the CONFIG_* associated
diff /tmp/driver_compiled.txt /tmp/driver_loaded.txt | grep "<" | awk '{ print $2 }' | sort --unique | xargs -i zgrep -i {} /proc/config.gz | grep -v "# "
Offline
simion314, did you download a kernel archive and extract it before running the find command? It should find two files:
./drivers/net/e1000e/Makefile
./drivers/net/e1000/Makefile
Or is your ~/linux/src/linux-2.6.28-ARCH/ just a link to /usr/src/linux-2.6.28-ARCH/ ? The Arch kernel package does not contain these files.
Offline
simion314, did you download a kernel archive and extract it before running the find command? It should find two files:
./drivers/net/e1000e/Makefile ./drivers/net/e1000/Makefile
Or is your ~/linux/src/linux-2.6.28-ARCH/ just a link to /usr/src/linux-2.6.28-ARCH/ ? The Arch kernel package does not contain these files.
Yes i copied the source from /usr/src, so i need to download a vanila kernel?Or is a kernel26-source package in arch?
Offline
You need a vanilla kernel.
Offline
Pages: 1