Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs

Dashboard
Notifications
Mark all as read
Q&A

Does /proc/config.gz always contain all supported options of a kernel?

+4
−0

Assuming I have a running Linux system that has the /proc/config.gz file:

Does the (unpacked) file always contain all of the options the particular kernel supports, including commented out like:

#CONFIG_SOMETHING is not set

or is it possible that some options which the kernel supports do not appear at all in that file?

(the usefulness of knowing that for sure is to, perhaps, be able to do some problem hunting without currently having access to the buildroot config files that were used to create the Linux image at hand)

Why does this post require moderator attention?
You might want to add some details to your flag.
Why should this post be closed?

0 comment threads

1 answer

+3
−0

It is possible - while being unlikely - that /proc/config.gz does not match the actual kernel configuration.

Normally, /proc/config.gz should reflect the kernel configuration truthfully. But whether you can really rely on /proc/config.gz being truthful or not depends on the build process for the kernel (or in other words: where you got the kernel or its build files from).

In rare and extraordinary circumstances, a developer might decide to build a kernel with a certain configuration while letting /proc/config.gz pretend the kernel having a different configuration.

One such example case would be workarounds for compatibility issues, as is the case in this real-world project about a custom kernel for Xiaomi mido Android devices: https://github.com/franciscofranco/mido/commit/c9ea8d1f6bb5f9cd0c30053e98c2130b5a9499ab. To quote the message of the commit i linked to:

Userspace reads /proc/config.gz and spits out an error message after boot finishes when it doesn't like the kernel's configuration. In order to preserve our freedom to customize the kernel however we'd like, show userspace the stock config so that it never complains about our kernel configuration.

Why does this post require moderator attention?
You might want to add some details to your flag.

0 comment threads

Sign up to answer this question »

This community is part of the Codidact network. We have other communities too — take a look!

You can also join us in chat!

Want to advertise this community? Use our templates!