Multistrap rootfs won't execute init


#1

I’ve used multistrap to create a rootfs. (It seems out of debootstrap’s scope to include packages from multiple repositories.) But it won’t run /sbin/init, which is a symlink to /bin/sh, which in turn is a symlink to dash. The kernel looks like it’s working though.

Here are some considerations I’ve taken into account:

  • set the arch to armhf
  • copy files from the linux-image-… package to /boot/zImage and /boot/sun5i-r8-chip.dtb (evidently working due to kernel messages showing up)
  • create some entries in /dev, based on what cdebootstrap does
  • get some more messages to print, in case an error is lost in overscan

And I don’t see any error messages about init. What might be wrong?


#2

Update: there are signs that the kernel can access the filesystem properly: if I build the filesystem without /sbin/init, the kernel reports that the name of PID 1 is “sh” instead of “init”.

Incidentally, I leaned just now that Linux tries to execute /bin/sh if various init files don’t exist.
http://lxr.free-electrons.com/source/init/main.c#L969


#3

Turns out it does run, just not on screen. It runs attached to some other tty, probably the UART.