I'm desperately trying to get a self-compiled kernel running together with an initramfs. It worked on the old raspberry, but somehow I can't get it to run.
What I'm trying to do exactly: Load kernel, "run" initramfs with a busybox and some other tools, performing some checks (system-update etc.), mounting a squashfs image with the "real" system and invoking switch_root on said system.
But the kernel somehow refuses to run the initramfs' init. I tried various settings in cmdline.txt / config.txt but none of them seem to work, the kernel always waits for some root to be available (or fails with "VFS: unable to mount root fs on unknown block" depending on my setting of the root= flag). I assume that I'm missing some cmdline setting (probably a correct root=.... root=/dev/ram0 for example did not work) or a kernel flag. My current cmdline: dwc_otg.lpm_enable=0 console=tty1 elevator=deadline rootwait, config.txt: initramfs initramfs.gz followkernel. When I add root=/dev/mmcblk0p6 roottype=ext4 the whole system boots (into some test-linux I added to verify the kernel itself works).
I checked that the kernel is compiled with initramfs support (BLK_DEV_INITRD=y), compiling the initramfs into the kernel image is not an option sadly. The kernel (4.1 stable) is compiled using buildroot. Kernel binary format is zImage (seems not to work with vmlinux, screen stays black). The initramfs is created with find . -print0 | cpio --null --create --format=newc | gzip --rsyncable -9 > initramfs.gz.
Thanks for any input.
PS: FYI, I'm duplicating my unix.stackexchange post, as nobody seems to have an answer there. I hope that is ok.