I work at Broadcom and I was asked to see if I can get running our new chip with openwrt (at this point just a proof-of-concept). I substituted the tooolchain with our own and pointed to our own kernel tree (all done through make menuconfig). I did not change anything else in the openwrt config - all default packages. The build succeeded and I have a vmlinux, vmllinux-initramfs as well as rootfs.tar.gz
Unfortunately my board fails during the boot process fails with the following error:
[ 3.966865] VFS: Mounted root (ubifs filesystem) readonly on device 0:12.
[ 3.975124] devtmpfs: mounted
[ 3.978231] Freeing unused kernel memory: 264K (c0745000 - c0787000)
[ 3.996134] Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.
[ 4.009279] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.14.13-1.2pre_rgu-1.5.00 #10
[ 4.016963] [<c00149f8>] (unwind_backtrace) from [<c0010f08>] (show_stack+0x10/0x14)
[ 4.024721] [<c0010f08>] (show_stack) from [<c056c3f8>] (dump_stack+0x80/0x90)
[ 4.031955] [<c056c3f8>] (dump_stack) from [<c056a6f8>] (panic+0xa4/0x1f0)
[ 4.038840] [<c056a6f8>] (panic) from [<c0567510>] (cpu_die+0x0/0x80)
[ 4.045290] [<c0567510>] (cpu_die) from [<00000000>] ( (null))
I tried booting using vmlinux-initramfs and also tried vmlinux with the rootfs from the flash. The same error in both cases.
To see if the openwrt rootfs produced by the build is good I booted my board with the rootfs produced by the regular Broadcom build and mounted the openwrt rootfs. The mount succeeds and I can see the expected directory structure but any attempt to execute any of the binaries in the openwrt rootfs tree results in the following error:
# /mnt/flash/bin/busybox
sh: /mnt/flash/bin/busybox: No such file or directory
With strace:
# strace /mnt/flash/bin/busybox
execve("/mnt/flash/bin/busybox", ["/mnt/flash/bin/busybox"], [/* 9 vars */]) = -1 ENOENT (No such file or directory)
dup(2) = 3
fcntl64(3, F_GETFL) = 0x20002 (flags O_RDWR|O_LARGEFILE)
fstat64(3, {st_mode=S_IFCHR|0600, st_rdev=makedev(4, 64), ...}) = 0
ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 opost isig icanon echo ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6f2b000
_llseek(3, 0, 0xbeae8a08, SEEK_CUR) = -1 ESPIPE (Illegal seek)
write(3, "strace: exec: No such file or di"..., 40strace: exec: No such file or directory
) = 40
close(3) = 0
munmap(0xb6f2b000, 4096) = 0
exit_group(1) = ?
It seems to me that the two problems (boot and executing mounted binary) are related but I am not sure what causes them.
Both Broadcom built and openwrt built busybox binaries seem to be compiled correctly:
# file /bin/busybox
/bin/busybox: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, stripped
# file /mnt/flash/bin/busybox
/mnt/flash/bin/busybox: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, stripped
Any help appreciated.