I am trying to build a OPNSense image for the BPI-R4 and have made some headway, I’m running into issues regarding booting due to u-boot not being found/recognized correctly. Can someone please confirm for me if the “u-boot-bananapi” pkg in FreeBSD is the correct one I should be using, and if not could someone point me in the correct direction for a compatible u-boot image I can use either in the creation itself or somehow inject into the opnsense.img I have compiled
I’m nearly sure freebsd does not support r4 yet. Uboot patches are mainline,but you need to set the right dts and drivers for a specific board. It is not like linux where you can compile all in and hw can be detected…
Thank you for the heads up, from what I understand the CPU should be compatible I am just having issues trying to get u-boot integrated in the build in the correct location. Could you point me in the correct location regarding getting it setup?
Just out of curiosity could either your build script or one of the prebuilt images be able to be injected into an existing img written to a SD card? i.e [“bpi-r4_sdmmc_bl2.img” + “u-boot-r4_2024.01-bpi-arm64-sd.bin” + “OPNSense.img”] Or would I have to try incorporate adding them to the makefile for the opnsense image I build myself?
By following the instructions you’ve written here? building and flash image Is it possible to do something similar from a windows host (i.e windows subsysytem for linux) or does it need to be done using a linux machine? (sorry for all the questions, I’m new to dealing with uboot and its causing me headaches)
Cause right now I’ve got a EFI bootable Aarch64 opnsense img, which when written to a sd card it creates a partition called MSDOSBOOT with a bootaa64.efi in it
I have not used WSL yet so i cannot answer this,but at least i think flashing directly in windows should work if you unpack the gz first.
For boot process you need at least bl2.img at offset 0 and then the fip needs to be flashed in a gpt partition named “fip” all other parts are optional.
Thanks for the information, I’ve tried both native windows and WSL and no luck, I can flash the bl2.img and fip fine but naming the partition has been causing me issues, I know it works cause when I plug it into the bpi4 it boots then cant find the fip partition. I don’t suppose you have an idiots guide on how to do it in either Ubuntu or FreeBSD?
Okay I’ve tried for a few days now and I am not making any progress, when running the following code below from a Ubuntu box I get the generic system halt error on the bpi4
Based on output bl2 is not found. The output is only bootrom.
So either the bootswitches are wrong (both down for sd),card is not recognized (inserted correctly,maybe unsupported/damaged card) or flashed bl2 is wring file (without sdmmc_boot header) or on wrong position (emmc needs different bl2 in boot0 part).
Have you taken bl2 file from my repo or self compiled?
You could try flashing the bpi-r4_sdmmc.img (unpack of gz needed) to card to check the bootswitches and card support. Then you can change partitions after fip for your needs.
I can confirm it boots successfully using the bpi-r4_sdmmc.img image so the SD card works, however I’ve had no luck getting anything booted when flashing to partition 6 using dd
pfSense will be harder as one of the package maintainers recently reported that the pfSense team has taken some source code into a private repository which means building pfSense CE (the open source version) isn’t currently possible. I don’t know if this situation will change.
I have no pipeline yet which builds for r4 yet,but you can use some branches to build it like 6.8-dango (which is newest one and already configured for r4 in build.conf).
Just use build.sh with importconfig param and without to build,pack to get a tar.gz with all needed binaries