title: Failed to execute /init
body: <p>I am trying to build a basic root filesystem using Buildroot, for an embedded system (the <a href="http://www.banana-pi.com/eacp_view.asp?id=65" rel="nofollow">Banana PI D1</a>).</p>
  
  <p>I am using a kernel from an <a href="https://github.com/Lamobo/Lamobo-D1" rel="nofollow">SDK supplied by the SoC vendor</a>. From this repo I am using only the kernel, found in src/kernel.</p>
  
  <p>There's nothing remarkable about the Buildroot configuration. It builds with no errors and the resulting root filesystem looks like it contains everything I would expect.</p>
  
  <p>I have configured it to build the filesystem as an initramfs embedded within the zImage.</p>
  
  <p>The kernel appears to start up correctly, but cannot load init and then panics:</p>
  
  <pre><code>Booting Linux on physical CPU 0
  Linux version 3.4.35 (harmic@penski.harmic.moo.org) (gcc version 4.8.4 (Buildroot 2015.02) ) #7 Sat Mar 21 22:59:18 AEDT 2015
  CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
  ...
  Kernel command line: root=/dev/mtdblock1 ro init=/sbin/init mem=64M console=ttySAK0,115200
  ...
  Freeing init memory: 4632K
  Failed to execute /init
  Failed to execute /sbin/init.  Attempting defaults...
  mmc0: host does not support reading read-only switch. assuming write-enable.
  mmc0: new SDHC card at address 0007
  mmcblk0: mmc0:0007 SD08G 7.42 GiB 
   mmcblk0: p1
  Kernel panic - not syncing: No init found.  Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.
  </code></pre>
  
  <p>I have tried a number of troubleshooting steps:</p>
  
  <ol>
  <li><p>I've built a root filesystem using <a href="https://github.com/tmonjalo/miniroot" rel="nofollow">this miniroot project</a> (took some doing, as it is quite out of date). It booted OK, using the same kernel as I am trying to use with the buildroot root fs.</p></li>
  <li><p>I've tried using both uClibc and eglibc</p></li>
  <li><p>I've tried using Buildroot's own cross-tools as well as the cross tools supplied by the SoC vendor</p></li>
  <li><p>I've confirmed that the built rootfs does include an /init (it does!)</p></li>
  </ol>
  
  <p>There is a gist <a href="https://gist.github.com/harmic/317893f7283e8b63a575" rel="nofollow">here</a> containing the buildroot configuration, a copy of the kernel boot log, and a listing of the contents of the generated filesystem.</p>
  
  <p>What steps can I take to troubleshoot this further?</p>
  
  <p>Update:</p>
  
  <ol>
  <li><p>The generated rootfs.cpio.gz weighs in at 2139200 bytes. I have read that there is a maximum size of initramfs you can use, but I have not been able to find where the hard limit is documented. </p></li>
  <li><p>I have attached a listing of the generated root filesystem to the gist linked above.</p></li>
  <li><p>I have unpacked the rootfs on the host and inspected it. /init contains this:</p>
  
  <pre><code>#!/bin/sh
  # devtmpfs does not get automounted for initramfs
  /bin/mount -t devtmpfs devtmpfs /dev
  exec 0&lt;/dev/console
  exec 1&gt;/dev/console
  exec 2&gt;/dev/console
  exec /sbin/init $*
  </code></pre>
  
  <p>/sbin/init is a symlink to /bin/busybox.</p>
  
  <p>/bin/busybox is dynamically linked:</p>
  
  <pre><code>$ file busybox
  busybox: setuid ELF 32-bit MSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, stripped
  $ ../../../host/usr/bin/armeb-buildroot-linux-gnueabi-readelf -a busybox | grep "Shared library:"
   0x00000001 (NEEDED)                     Shared library: [libc.so.6]
  </code></pre>
  
  <p>libc.so.6 is present in /lib. /lib32 is a symlink to /lib for good measure.</p></li>
  <li><p>The device has 64M RAM.</p></li>
  <li><p>Both the vendor's cross tools and the buildroot cross tools are set up for eabi</p></li>
  </ol>