Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am making an embedded Linux distribution and my board is a Raspberry Pi. My kernel version is 3.2.27 without initramfs and my root file system as follows:

/lib                          /* contains kernel modules */
/bin /sbin /usr/bin /usr/sbin /* contains busybox utils binaries */
/usr/lib                      /* contains cross-compiler tool chain libs */
linuxrc                       /* generated by busybox, kept in / */
/dev                          /* I have created console and ttyAM0 manually but added mode devices by udev */
/etc/init.d/rcS               /* required by busybox init */

after kernel booted I am getting a console (I don't know whether it is busybox console or not). I have few problems below

  • No process information available (no files/folder created under /proc).
  • When I am using ps -e it shows nothing.

Why this unexpected behavior happens?

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

After initialising and mounting the root file system, Linux starts /sbin/init which carries on with the user space initialisations including mounting /proc

Most likely your rcS or whatever configuration init reads doesn't do that, and you need to tell it to.

If you've got a shell prompt, you can mount /proc manually with:

mount -t proc p /proc

Note that the /proc directory must exist before you can mount something there. You should include it in your root image.

share|improve this answer
    
i have forgot to add this, thank you –  Shantanu Banerjee Dec 31 '12 at 9:09
add comment

2) is very likely because of 1) - ps uses /proc to get information about running processes.

1) is either because the initialisation isn't expected to do that or because it fails to do it. Check what the distribution is supposed to do on boot - how the system is to be brought up.

Things you can try:

  • mount /proc, e.g.: mount -t proc proc /proc - the second argument is arbitrary (it's what shows as the source of the mount). Check what is running with PID=1

  • check in /proc/cmdline what parameters your kernel receives on boot. If it contains init=... you might need to change it to e.g. /sbin/init or remove it to let kernel try to resolve the init to be run itself. You have to do this in bootloader configuration (for R-Pi this is in some text file on the SD card IIRC).

  • Check that the desired init executable exists - Busybox normaly has tons of symlinks pointing to its binary so that one can use command [args] rather than busybox command [args]. Your might be missing those.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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