I have a use case where I need OpenWRT on initramfs. I have created openwrt-x86-64-generic-initramfs-kernel.bin.
By googling "initramfs-kernel" stands for kernel appended with rootfs, but dont got idea how to load using USB stick.
Can someone please help me load this on x86 router. I didn't find any documentation on this.
It boots the same as a regular kernel. The difference is that a kernel blob built as initramfs doesn't mount a physical rootfs while it is starting up. All of its root files are packed into the blob itself, so it mounts them as a RAM disk.
Up until the loading and starting of the kernel blob in RAM, the boot process is exactly the same as a regular install. First the UEFI BIOS will mount the UEFI partition, find the directory to boot, load grub2, then grub2 loads the kernel file.
So converting to initramfs is simply to replace the vmlinuz file that grub2 ultimately loads with the initramfs one.