Divide
Divide

Reputation: 29

Meaning of the code in the linux-kernel config file

I want to config and build a kernel for raspberry pi 3. But when I read a config file, I don't know what is the mean of code in the linux-kernel config file. I try search it but I can't find it.

EX:

CONFIG_SYSVIPC=y -> what does CONFIG_SYSVIPC mean?

CONFIG_POSIX_MQUEUE=y -> what does CONFIG_POSIX_MQUEUE mean?

Upvotes: 2

Views: 1994

Answers (2)

sawdust
sawdust

Reputation: 17047

I try search it but I can't find it.

Use find piped to grep to locate the definition(s) of the configuration parameter in the Kconfig* files in the kernel source:

find . -name "Kconfig*" | xargs grep "config PARM"

where PARM is the text of CONFIG_PARM.

The tree structure of Kconfig* files and the menu entires are documented in https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt


CONFIG_SYSVIPC=y -> what does CONFIG_SYSVIPC mean?

Using the search method produces

/home/test/linux-4.4.1$ find . -name "Kconfig*" | xargs grep "config SYSVIPC"
./arch/x86/Kconfig:config SYSVIPC_COMPAT
./arch/mips/Kconfig:config SYSVIPC_COMPAT
./arch/powerpc/Kconfig:config SYSVIPC_COMPAT
./arch/parisc/Kconfig:config SYSVIPC_COMPAT
./arch/s390/Kconfig:config SYSVIPC_COMPAT
./arch/ia64/Kconfig.debug:config SYSVIPC_COMPAT
./arch/sparc/Kconfig:config SYSVIPC_COMPAT
./arch/tile/Kconfig:config SYSVIPC_COMPAT
./arch/arm64/Kconfig:config SYSVIPC_COMPAT
./init/Kconfig:config SYSVIPC
./init/Kconfig:config SYSVIPC_SYSCTL
/home/test/linux-4.4.1$

Besides the arch-dependent entries, the init subsystem has the primary configuration entry in init/Kconfig.
If you're lucky, there's a decent explanation in the "help" section.

config SYSVIPC
        bool "System V IPC"
        ---help---
          Inter Process Communication is a suite of library functions and
          system calls which let processes (running programs) synchronize and
          exchange information. It is generally considered to be a good thing,
          and some programs won't run unless you say Y here. In particular, if
          you want to run the DOS emulator dosemu under Linux (read the
          DOSEMU-HOWTO, available from <http://www.tldp.org/docs.html#howto>),
          you'll need to say Y here.

          You can find documentation about IPC with "info ipc" and also in
          section 6.4 of the Linux Programmer's Guide, available from
          <http://www.tldp.org/guides.html>.

CONFIG_POSIX_MQUEUE=y -> what does CONFIG_POSIX_MQUEUE mean?

Using the search method produces

/home/test/linux-4.4.1$ find . -name "Kconfig*" | xargs grep "config POSIX_MQUEUE"
./init/Kconfig:config POSIX_MQUEUE
./init/Kconfig:config POSIX_MQUEUE_SYSCTL
/home/test/linux-4.4.1$ 

Inspection of init/Kconfig finds this configuration entry:

config POSIX_MQUEUE
        bool "POSIX Message Queues"
        depends on NET
        ---help---
          POSIX variant of message queues is a part of IPC. In POSIX message
          queues every message has a priority which decides about succession
          of receiving it by a process. If you want to compile and run
          programs written e.g. for Solaris with use of its POSIX message
          queues (functions mq_*) say Y here.

          POSIX message queues are visible as a filesystem called 'mqueue'
          and can be mounted somewhere if you want to do filesystem
          operations on message queues.

          If unsure, say Y.

Of course you should not be directly editing a .config file.
Use the menuconfig (or similar) make target (e.g. make menuconfig) to ensure that all dependencies are satisfied and that all auto-selects will be enabled.

Upvotes: 1

Rajeshkumar
Rajeshkumar

Reputation: 798

Kernel config file used to configure the kernel, like enable/disable the drivers.

CONFIG_PCI=y means, The PCI part in the kernel source code will be included for compilation. We would enable PCI in config file if PCI interface available in hardware.

CONFIG_SYSVIPC=y enables message queues, semaphore sets, and shared memory segments in kernel.

CONFIG_POSIX_MQUEUE=y enables posix message queues in kernel.

Refer the below link for better understanding, http://www.tldp.org/HOWTO/SCSI-2.4-HOWTO/kconfig.html

Upvotes: 0

Related Questions