I am quite new to Banana PIs but have a lot of experience with Raspberries. Reason why I have obtained a Banana PI is the fact that it provides boards with multiple LAN ports. With the R2 I am planning to replace my Router with an OpenWrt one. The fact that the PI provides 4 LAN ports is even better as I have currently 3 different subnets which I can separate physically also.
Besides the fact that I need to learn how those boards are being fed with software there is one point for which I have not found an answer so far: is it possible to configure the Banana PI to boot from a NFS network mount? All my Raspberries are set up to boot from different folders on a NAS system and I like the fact that I do not need to bother about SD card issues and also the backup/restore is quite easy. How to achieve same/similar setup with a Banana PI and OpenWrt?
you need at least preloader+uboot on local storage (sd/emmc),then you can load linux-kernel (tftp) and rootfs (nfs) via network.on sdcard you need additional bootheaders (sdmmc-boot+brlyt).you can try flashing my debian for first steps (loading kernel from tftp and then rootfs)
I had wrote down my steps quick and dirty in my wiki.
thank you very much for your answers. I have successfully installed an OpenWrt image on my SD card and can boot the bpir2.
The next step to take is either
move rootfs to nfs share (preferred)
move rootfs to EMMC
For both options I do not have an idea yet how to proceed.
@frank-w: great that there is a way to make the bpi boot from nfs, question is only if I can achieve that also with the OpenWrt image I am currently using. Any ideas from your side?
For the second option, is it possible to “move” the current rootfs content to EMMC and mount this as rootfs upon boot? Or is it not the way the boot process is working on bpi? On an raspberry this is basically what happens: on a boot partition you are configuring (via config.txt) where the rootfs should be loaded from. This is very easy, but I guess not the way bpi works…
Any hints on which option to choose and where to find information about how to do it are very much appreciated!
For openwrt i have no idea because i don’t use it.
but in debian/ubuntu it’s default to use rootfs from sd/emmc. This is also my current way for testing kernels (kernel/dtb from tftp and local rootfs). You install image the normal way and only change kernel-source in uboot (leave root/bootargs as it is root=/dev/mmcblkxpy to inform kernel where the rootfs is located)
Or you copy rootfs from sd to emmc (rsync) skipping dynamic folders like /proc, /sys,/dev and change fstab to new rootfs-device
Something like this after mounting new rootfs to /mnt/emmc-root):
but it seems for all these techniques I need access via serial console, is that right? I know that the bootargs-line shown in those examples is similar to the config.txt on a raspberry pi. But as there is no config.txt on bpi I guess only direct access via console will work here. Or are there any linux utilities that allow to change the bootargs from bash?
I have now setup my bpi-r2 with openwrt 18.06.2 and the configuration seems to work fine. One thing left is to move the rootfs now to NFS or EMMC. Which way should I go here in your opinion? I guess moving it to EMMC will be easier, but I am not sure… I have seen several posts on Google how to transfer rootfs to EMMC but to be hones I am a little bit afraid of blowing everything… What is the simplest way to achieve the moving?
with the help of some users in the OpenWRT forum I have setup my BPI to boot from NFS successfully. The current configuration loads the kernel from SD and the root file system from the nfs share. This is a setup I can live with. Thank you for your help!
the above line needs to replace the “root”-statement in the default kernel boot args. After compiling it I have moved the kernel (7623n-bananapi-bpi-r2-kernel.bin => uImage) to SD card and the root fs to my NFS share.
Today I will check why the kernel args in uEnv.txt are not considered. If I will find out anything useful I will post it here.