5

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??

1

1 Answer 1

7

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.

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .