I’ve bought Banana Pi R2 with plan to make it into my very custom OpenWRT-based router. This is my second type of Linux-friendly board, first one I had were Raspberry Pi 2, 3 and Zero where I am familiar with booting procedure and preparing the custom Linux systems with Buildroot. I’ve played a bit with the booting ecosystem of R2 (100MB for magic bytes, preloader and uboot, BPI-BOOT vfat partition for kernel and uboot config and BPI-ROOT ext4 for rootfs), using files from BPI-files github repository (https://github.com/BPI-SINOVOIP/BPI-files). Thanks to Uboot and boot-root partition scheme I am able to launch Buildroot-compiled system, as long as it consists of kernel (eg. zImage) and root image I can flash to the second partition.
However, after compiling OpenWRT github repo for R2 (https://github.com/BPI-SINOVOIP/BPI-R2-OPENWRT-18.06), the only thing I get *-initramfs-kernel.bin file. I’ve checked beginning of that file and it significantly differs from the files meant to be flashed in case of LEDE repository (BPI-R2 OpenWRT(LEDE) Support). SDMMC_BOOT magic bytes are missing, there is no preloader nor uboot starting with 2048 byte of the file.
After flashing LEDE’s image on the SD card I have no access to partitions where I could possibly put the bin file from my Linux desktop. How are things looking like in case of OpenWRT on Banana Pi? It clearly isn’t the same situation as in case where BPI-BOOT is available, yet the compiled bin file has to be placed in the SD card somehow. I admit I didn’t play nor compile the system with squashfs and jffs2 yet so I’m new to how Linux and OpenWRT handle that. If I had access to uboot configuration file, I guess I could figure it out from the kernel arguments, but as I said, there is no such file - at least not in an easily accessible form.
I’m wondering how one could prepare an SD card from scratch by partitioning it and flashing necessary images from BPI-files repository (either with dd or bpi-tools) and finally use OpenWRT’s bin file to somehow put it on the SD card so that it boots up after plugging into the BPI? How does jffs2 partition handling and configuration look like (specifying size, location on the SD card etc)?