4

I have an Android TV stck I compiled Linux for IT from https://github.com/Galland/rk3x_kernel_3.0.36

But when I booted that Image I found /proc/config.gz is of 0 bytes

can some please explain how the command line params from .config file in kernel source get mounted to /proc. I mean what goes in the background??

6

Files in /proc do not have a file size in general, and are shown as having 0 size in ls -l, but you can read data from them anyway (see man 5 proc).

Try, for example:

zcat /proc/config.gz | wc

or:

$ ls -l /proc/cmdline
-r--r--r-- 1 root root 0 Aug  4 10:16 /proc/cmdline

Looks empty. But:

$ cat /proc/cmdline | wc
      1       5     114

it contains data. Let's see:

$ cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-3.13.0-24-generic root=UUID=fc48808f-8f06-47fc-a1fe-5d08ee9e0a50 ro noirqdebug nomodeset

feels like a normal file - except if you want to do anything special, like reading by blocks, seek(), or loking at the size.


In case you can not read /proc/config.gz, there is a file that normally contains the same:

less /lib/modules/$(uname -r)/build/.config

See man proc for details.

  • ever so thrifty. It is admirable. – mikeserv Aug 4 '14 at 8:22
  • Hey, I did not recycle that, like last time :) – Volker Siegel Aug 4 '14 at 8:29
  • I know, and I deleted the comment. But recycling is good for the planet. – mikeserv Aug 4 '14 at 8:31
  • 1
    zcat /proc/config.gz worked for me ..... Thanks a lot – Tiwari Aug 6 '14 at 1:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.