Booting from initramfs


#1

Hello all,

I am trying to configure my A10 SoC to boot from an initramfs mount. I’ve reconfigured by buildroot/busybox and Kernel by following the instructions here: https://rocketboards.org/foswiki/Documentation/BuildingInitramfsKernels. Its a little dated but I believe everything still applied. I did however make one change, it seems the newer Kernels can take the cpio archive directly without the need to generate the file list. Perhaps that is my issue but after I boot the new Kernel I get the following error messages:
[ 2.240159] mmc0: new high speed SDHC card at address 0001
[ 2.246302] mmcblk0: mmc0:0001 SD8GB 7.24 GiB
[ 2.252387] mmcblk0: p1 p2 p3
[ 2.253834] request_module: runaway loop modprobe binfmt-464c
[ 2.273715] request_module: runaway loop modprobe binfmt-464c
[ 2.282457] Failed to execute /init (error -8)
[ 2.298802] Starting init: /sbin/init exists but couldn’t execute it (error -8)
[ 2.319057] Starting init: /bin/sh exists but couldn’t execute it (error -8)
[ 2.326126] Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.
[ 2.339200] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.1.22-ltsi #11
[ 2.345611] Hardware name: Altera SOCFPGA Arria10
[ 2.350340] [] (unwind_backtrace) from [] (show_stack+0x20/0x24)
[ 2.358060] [] (show_stack) from [] (dump_stack+0x98/0xac)
[ 2.365254] [] (dump_stack) from [] (panic+0xb4/0x21c)
[ 2.372102] [] (panic) from [] (cpu_die+0x0/0x98)
[ 2.378519] [] (cpu_die) from [] (ret_from_fork+0x14/0x2c)
[ 2.385712] CPU0: stopping
[ 2.388412] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.1.22-ltsi #11
[ 2.394822] Hardware name: Altera SOCFPGA Arria10
[ 2.399514] [] (unwind_backtrace) from [] (show_stack+0x20/0x24)
[ 2.407225] [] (show_stack) from [] (dump_stack+0x98/0xac)
[ 2.414418] [] (dump_stack) from [] (handle_IPI+0x1a4/0x2b4)
[ 2.421783] [] (handle_IPI) from [] (gic_handle_irq+0x68/0x6c)
[ 2.429319] [] (gic_handle_irq) from [] (__irq_svc+0x40/0x54)
[ 2.436765] Exception stack(0xc093ff20 to 0xc093ff68)
[ 2.441796] ff20: 00000000 00000000 00001d2e c0022460 c093e000 c094049c 00000001 c09a6a20
[ 2.449937] ff40: c0597a30 c0938304 c09a8f40 c093ff74 c093ff78 c093ff68 c001049c c00104a0
[ 2.458074] ff60: 60000113 ffffffff
[ 2.461551] [] (__irq_svc) from [] (arch_cpu_idle+0x48/0x4c)
[ 2.468928] [] (arch_cpu_idle) from [] (cpu_startup_entry+0x154/0x298)
[ 2.477157] [] (cpu_startup_entry) from [] (rest_init+0x88/0x8c)
[ 2.484872] [] (rest_init) from [] (start_kernel+0x3c8/0x3d4)
[ 2.492331] —[ end Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.

I haven’t been able to successfully generate a file list from the resulting archive but I am currently trying to Google how to do that. The script from the above link fails.

Thank you in advance for any suggestions!
-Steve


Linux initramfs with QSPI
#2

It looks like your initramfs missing the init script or maybe the script isn’t executable.


#3

Thanks for the reply!

I’ve tried to extract it and i believe the permissions are correct:

From there i repackaged it using the script from https://www.kernel.org/doc/Documentation/filesystems/ramfs-rootfs-initramfs.txt that takes a directory and creates the cpio.gz file. Still receive the same error.

Are you familiar with he “root=” parameter passed to the Kernel? I think I need to change that (and possibly others) from the defaults on my board (A10 SoC) that was booting off the SDCARD.


#4

Just to close the loop I was able to figure it out - I had copied my busybox, buildroot and kernel directories to new locations where I could play with the new settings for initramfs. I must have “cleaned” something because my buildroot reverted back to the default configuration and of course didn’t have my cross compiler settings in it.

Once I corrected the cross compile settings and rebuild I was able to execute busybox and get into Linux just fine!

One thing that was hard for me to find was the following change to the uboot environment settings so I will post that here as well.

Original setting:
mmcboot=setenv bootargs console=ttyS0,115200 root=${mmcroot} rw rootwait;fpgabr 1;bootz ${loadaddr} - ${fdtaddr}

New setting:
mmcboot=setenv bootargs console=ttyS0,115200 ;fpgabr 1;bootz ${loadaddr} - ${fdtaddr}

(all others were untouched)

-Steve