LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Kernel configuration according to hardware (https://www.linuxquestions.org/questions/linux-from-scratch-13/kernel-configuration-according-to-hardware-4175433482/)

drimades 10-22-2012 07:44 AM

Kernel configuration according to hardware
 
I'm trying to build a small kernel image with the minimal requirements based on the hardware I have in my laptop. Any idea about how to deal with that? How can I get info about my hardware and somehow translate it in kernel configuration settings?

druuna 10-22-2012 07:56 AM

Basic tools to get hardware info:
Code:

lspci
lsusb
lshw
dmesg

Some of the above command might not yet be installed on your system.

Also: When compiling the kernel you might want to run make defconfig, which sets entries to the default symbol values from either arch/$ARCH/defconfig or arch/$ARCH/configs/${PLATFORM}_defconfig, depending on the architecture.

This means doing one extra step when building the kernel:
Code:

make mrproper  # as stated in the LFS book
make defconfig  # the extra step
make menuconfig # as stated in the book

Use the make menuconfig step to tweak with the info found by the hardware info commands.

drimades 10-22-2012 08:17 AM

Thanks for your answer!
I've used lspci -k to have a list of the PCI device drivers in use. I used it to configure the kernel, but it helps only for the PCI devices. Is there any similar option for the other commands you mentioned?

druuna 10-22-2012 09:00 AM

Quote:

Originally Posted by drimades (Post 4812148)
I've used lspci -k to have a list of the PCI device drivers in use. I used it to configure the kernel, but it helps only for the PCI devices.

This only shows drivers that are used and thus present and set as kernel option.

You might use this info if the command was given on a system that actually recognizes and sets-up all(??) hardware/devices.

Quote:

Originally Posted by drimades (Post 4812148)
Is there any similar option for the other commands you mentioned?

Assuming that options are set to be modular, you might have a look at the following output:
Code:

cat /proc/modules
Some info on character/block devices can be found here:
Code:

cat /proc/devices

Keith Hedger 10-22-2012 10:23 AM

This : http://kmuto.jp/debian/hcl/ might be useful


All times are GMT -5. The time now is 05:48 AM.