0

I've a device on which I've a 3.10 linux kernel booting up to a busybox shell (initramfs)

When I extracted the busybox filesystem image on the SD card and when modified the root from root=/dev/ram to /dev/mmcblck0p1, it still boots up to the shell So the busybox works fine but if I try to use any other FS the kernel would crash...

While I try to generate a rootfs using debootstrap (https://help.ubuntu.com/community/DebootstrapChroot) and have the new rootfs extracted on the SD card. I get an error saying "Failed to execute /sbin/init" I did check if the file is present and also checked the permissions and it looks good to me.

What could be the problem?

W.R.T rootfs I'm particularly new. I was assuming that any FS on the SD card could be mounted but looks like its not the case. I'm guessing that whatever the /sbin/init will be doing is device dependent?

What I am trying to do? ---> I need to make a rootfs with a few packages and libraries (gcc python etc..) What would a normal approach? I've even tried buildroot but I couldn't get gcc on target. Is it not possible to have gcc in /bin/ within buildroot?

-- UPDATE --

I'm formatting the SD card to ext4 format and following is the output of fdisk

Disk /dev/sdb1: 7945 MB, 7945588224 bytes
255 heads, 63 sectors/track, 965 cylinders, total 15518727 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc2aa4908

Device Boot      Start         End      Blocks   Id  System

And following are the kernel logs while I have a filesystem on the SD card. The memory card driver works fine I've verified that. If I have a busybox filesystem on the SD card, everything works fine. When I'm using any other file systems I get the following...

6EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null)
6VFS: Mounted root (ext4 filesystem) on device 179:1.
6Freeing unused kernel memory: 84K (c0f00000 - c0f15000)
3request_module: runaway loop modprobe binfmt-464c
4kworker/u2:4 (145) used greatest stack depth: 6132 bytes left
3Failed to execute /sbin/init.  Attempting defaults...
3request_module: runaway loop modprobe binfmt-464c
3request_module: runaway loop modprobe binfmt-464c
0Kernel panic - not syncing: No init found.  Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.

When checked, there is /sbin/init with the appropriate permissions that too!

kimi
  • 315
  • 3
  • 11
  • What filesystem your sdcard is formatted with? – oakad Apr 24 '14 at 01:37
  • 2
    You need to include the console output in your post so that we can see where the boot fails. You need to make sure that there is an MMC driver in your kernel or in a module that is loaded when in the initramfs. Your kernel boot args need to indicate the filesystem type. It would be good if you posted the fdisk print output for your SD. – Jonathan Ben-Avraham Apr 24 '14 at 05:28
  • @oakad ext4 filesystem – kimi Apr 28 '14 at 23:01
  • @JonathanBen-Avraham yes, edited in the original post itslef – kimi Apr 28 '14 at 23:01
  • Post the output of the "p" (print) command in fdisk. Is the root filesystem in the *first* partition on the SD? Because the first partition is what your kernel is trying to mount. Are you sure that U-Boot isn't in the first partition and the filesystem is in the second partition? – Jonathan Ben-Avraham Apr 30 '14 at 15:03

1 Answers1

0

Consider this error: "request_module: runaway loop modprobe binfmt-464c"

In all probability you're trying to use 64b binaries (/sbin/init and the rest) with 32b only kernel. Either recompile your kernel to support 64b or install a 32b user space onto your sd card.

Other things to check:

  1. Confirm that elf support is indeed enabled in your kernel (it normally is, but it is possible to disable it).
  2. Google that error and see what sort of problems people were having with it.
oakad
  • 6,945
  • 1
  • 22
  • 31
  • I checked /sbin/init and its a 32 bit elf + my kernel is a 3.10 kernel 32 bit too. The userspace I'm using is Ubuntu Raring's userspace but the 3.10 kernel is altogether different. Could that be a problem? – kimi Apr 29 '14 at 18:24
  • Check the kernel config then. It's plainly incapable of loading the elf executables. – oakad Apr 30 '14 at 01:26