Find linux kernel options

How do I find Linux config options in menuconfig?

Various web pages tell me that to get full truthful stack backtraces in the Linux kernel, I need to set CONFIG_FRAME_POINTER=y in my .config file. So I run make menuconfig and try to find it in there, but it’s hardly intuitive where to navigate to do so. I search the web and find lots of pages that say to enable it, but no pages that tell me what menu options to drill down into in order to do so. So I think maybe I could run make config and just hit [Enter] a million times to select the current configuration choice for everything, then copy-paste the whole command window buffer contents into a text file & search (case insensitive) for «frame_pointer» or «frame pointer», but still no luck; apparently I’d have to select ‘y’ for some submenu to even drill down to wherever it is. How can I find such options in config or menuconfig? Is there an option configuration hierarchy listed somewhere? I’m using Linux Kernel v2.6.30.4-uc0; that’s what I’m given with the Lantronix XPort Pro SDK. Based on answers I got, I use the / search option (not sure how I missed that before), but I’m not really able to get much farther. When I search for «FRAME_POINTER» this is what I see:

Symbol: ARCH_WANT_FRAME_POINTERS [=n] Symbol: FRAME_POINTER [=n] Prompt: Compile the kernel with frame pointers Defined at lib/Kconfig.debug:620 Depends on: DEBUG_KERNEL && (CRIS || M68K || M68KNOMMU || FRV || UML || AVR32 || SUPERH || BLACKFIN || MN10300) || ARCH_WANT_FRAME_POINTERS Location: -> Kernel hacking Selected by: LOCKDEP && DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT && !MIPS && !PPC && !ARM_UNWIND && !S390 || FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_ 

Note that the «Selected by:» line is longer than what I can see, even when I stretch the make menuconfig window as wide as the whole screen, and there’s no option I can find to scroll the text to see it all. Very frustrating, as most of this ordeal has been. So I try to navigate to this option using the «search» information above, but it’s still nowhere to be found! When I go to the Kernel hacking —> menu, there is no choice to enable stack frames. There is also no menu choice «Compile-time checks and compiler options» as indicated in @ShantanuAde’s answer. I see these choices:

------- Kernel hacking ------------------------- [ ] Show timing information on printks [ ] Enable __deprecated logic [ ] Enable __must_check logic (1024) Warn for stack frames larger than (needs gcc 4.4) [ ] Magic SysRq key [ ] Enable unused/obsolete exported symbols [ ] Debug Filesystem [ ] Run 'make headers_check' when building vmlinux [ ] Kernel debugging [ ] Debug memory initialisation [ ] Check for stalled CPUs delaying RCU grace periods [ ] Sysctl checks [ ] Sample kernel code ---> [ ] Full Symbolic/Source Debugging support [ ] Use fast second timer for profiling [ ] Compiled-in Kernel Boot Parameter [ ] Suppress Kernel BUG Messages 

The only thing I can think of that might get me closer to CONFIG_FRAME_POINTER is «Kernel debugging» but when I turn that on, the only extra options I get are:

[*] Kernel debugging [ ] Debug shared IRQ handlers (NEW) [*] Detect Soft Lockups (NEW) [ ] Panic (Reboot) On Soft Lockups (NEW) [*] Detect Hung Tasks (NEW) [ ] Panic (Reboot) On Hung Tasks (NEW) [*] Collect scheduler debugging info (NEW) [ ] Collect scheduler statistics (NEW) [ ] Collect kernel timers statistics (NEW) [ ] Debug object operations (NEW) [ ] Debug slab memory allocations (NEW) [ ] Spinlock and rw-lock debugging: basic checks (NEW) [ ] Mutex debugging: basic checks (NEW) [ ] Spinlock debugging: sleep-inside-spinlock checking (NEW) [ ] Locking API boot-time self-tests (NEW) [ ] kobject debugging (NEW) [ ] Verbose BUG() reporting (adds 70K) (NEW) [ ] Compile the kernel with debug info (NEW) [ ] Debug VM (NEW) [ ] Debug the global anon/private NOMMU mapping region tree (NEW) [ ] Debug filesystem writers count (NEW) 

Источник

Читайте также:  Astra linux сбросить настройки сети

Where can I find the kernel configuration on each Linux distribution?

I’m pretty sure that all Red Hat and Debian based distributions follow the convention of shipping the kernel configuration in /boot/config-* , but what of other distributions? Or, if this convention is extremely common, which distributions don’t follow it?

This, I think, is a which distribution. question which does not rely on opinion for answer. Kind of a breath of fresh air — there aren’t too many of those. Also, it’s interesting. Thanks.

@mikeserv too broad might fit, though. 😛 On-topic: I think Arch Linux doesn’t. But I don’t have a installation handy to check.

@muru — arch here: ls: cannot access /boot/config*: No such file or directory . But, then again, an archer’s /boot is a very personal thing. On the other hand, ls /proc/config.gz is entirely successful.

2 Answers 2

Debian and derivatives (Ubuntu, Linux Mint, …)

The configuration for the kernel /boot/vmlinuz-VERSION is stored in /boot/config-VERSION . The two files ship in the same package, linux-VERSION or kernel-VERSION .

Arch Linux, Gentoo (if enabled)

The configuration for the running kernel is stored in the kernel binary and can be retrieved with zcat /proc/config.gz .

This file exists when the CONFIG_IKCONFIG option is set when compiling the kernel — and so can be true (or not) regardless of distribution, though the default kernel configuration for the two named does enable it.

Incidentally, arch linux’s default configuration does not name the kernel (or its initramfs image) by version even in /boot — the files there are named only for their corresponding packages. For example, a typical arch linux boot kernel is named /boot/vmlinuz-linux where linux is the package one installs for the default kernel.

Читайте также:  Astra linux fstab pdac

The linux kernel source comes with an installation mechanism, make install . This installs files into /boot (vmlinuz-version, System.map-version, and config-version).

The option to make the running kernel’s config available via /proc/config.gz is part of the kernel too, so if this config option has been enabled the file will exist in the /proc filesystem. Almost all distributions have this enabled these days, even Android kernels, and as such, this is the most standard location.

Neither of these locations is dependent on the distribution though. Many distributions take advantage of the ‘default’ location when packaging, as it’s probably convenient to prepare packages this way, but even within a single distribution it’s possible that non-standard kernel packages might place the files elsewhere, or name them differently, although this is unlikely.

Источник

Where can I find linux kernel config options and description?

I am compiling a custom Linux kernel from the source tree, is there any place where all the Linux kernel config options and description is available. It is hard to find a description for each option and its use-case.

2 Answers 2

Options with descriptions are specified in Kconfig in each subdirectoy. To see all of them, you need to concatenate all Kconfig files (e.g. using find ), or you can do something like make menuconfig , where you have a hierarchical menu with descriptions as help texts.

The currently selected options are stored in the .config file in the root directory.

Are you perhaps trying to write a kernel .config file manually from scratch? The kernel source Makefiles have built-in configuration tools: for example, run make menuconfig to get a text-based menu interface for configuring the kernel. See Documentation/admin-guide/README.rst for a complete list of configuration tools available.

The configuration tools include a help function that will be able to describe most options. Those options that don’t have a help description tend to be one of the following:

  • very new, possibly experimental parts of the kernel (so a help description has not been written yet — feel free to submit a patch to add a suitable description in this case).
  • technical settings that are determined automatically based on other settings (for example, when you set the CPU type, a whole lot of settings are automatically set according to the features available in that CPU type)
  • debugging settings that are intended for the developers of a particular driver or other kernel component only — if you need to change these, you should either be one of those developers or at least already contacting them.

The help texts come from the Kconfig files in each sub-directory of the kernel source code.

Источник

How to Check Kernel Version in Linux in Command Line

The Linux kernel is much like the central brain of the operating system. Although it is open-source – meaning anyone can view and modify the code – the Linux kernel is built with multiple protocols to ensure stability and security.

Читайте также:  Ssh keygen rsa linux

This guide will walk you through how to check the Linux kernel version of your distribution.

how to check linux kernel version command line

  • A system running Linux (Ubuntu, Debian, RHEL, CentOS, or another version)
  • A terminal window / command line (CtrlAltT, CtrlAltF2)

4 Commands to Find Linux Kernel Version

uname Command

Launch a terminal window, then enter the following:

The system will return a numeric code, for example:

Each number, separated by a dot or hyphen, is part of a code:

uname command to check kernel version

The uname command includes additional options that you can use to get more information about your kernel. Simply add an option after the command:

  • -a – Display all information
  • -o – Display the operating system (usually GNU/Linux)
  • -r – Display kernel release
  • -v – Display kernel version (usually includes the base OS and time the kernel was compiled)

For a full list of uname commands, enter

uname command for more kernel information

Note: Your kernel version will likely be different than this example. At the time of writing this article, the latest version is Linux kernel 5.0.

hostnamectl Command

The hostnamectl command is typically used to display information about the system’s network configuration. It also displays the kernel version.

To check the kernel version, enter the following:

The second-to-last line should read:

Kernel: Linux 3.10.0-957.21.2.el7.x86_64

hostnamectl

Display the /proc/version File

To display the proc/version file, enter the command:

The cat command displays the contents of the /proc/version file. This will output the Linux kernel version first, along with additional data about your operating system.

display proc_version file

dmesg Command

The dmesg command is used to print the message buffer of the kernel. This is usually used to read messages from device drivers, but it can also be used to find the kernel version.

The | (pipe) symbol is usually on the same key as the symbol, just above the enter key.

dmesg command

The commands work as follows:

  • dmesg – read the contents of the kernel buffer
  • | – pipe the command into the next command
  • grep – search for a particular string of characters, and display lines that contain them
  • Linux – the exact string of characters that grep should search for (capitalization matters)

The first line of output displays the Linux kernel version.

Note: When updating your kernel, it is recommended that you choose a release version that’s compatible with your version of Linux. Your package manager will typically give you kernel versions that are tested and verified.

This guide showed you several different ways to check the Linux kernel version. Since you’re only reading the output of a file, you shouldn’t need sudo privileges.

The Linux kernel has a modular design. Functionality is extendible with modules or drivers. Learn how to use the modprobe command to add or remove modules on Linux.

Источник

Оцените статью
Adblock
detector