But… Mine isn’t openwrt…
That’s fine. I just want to boot the R4.
Probably a discussion by itself, and one worth having imho:
In my experience SanDisk SD cards are fine – as long as what you buy turns out to be actually “made” by SanDisk (or at least intended by SanDisk to carry their logo…). Out of 10 times buying micro SD cards in major retail shops, I had more than half of them turn out to be fake (easy to identify using mmc-utils as vendor/product IDs don’t match). Chances of getting fakes turns out to be the highest for SanDisk and Kingston brands, probably because those are known and popular brands but selling different things made in different factories.
So general recommendation regarding microSD cards, no matter which brand: Buy them directly from the manufacturer and avoid any intermediates because they will fool you. I got so annoyed by seeing micro SD cards having problems before even written completely full for the first time, at some point I ordered a batch of super high end Samsung Pro EVO cards from samsung.com and those work fine now for a long time, total written data in the terrabytes for a 32 GiB card.
I had many cards flying around, Kingston, Sandisk, Toshiba, Transcend, … all of them have died in the meantime. One very cheap AData one seems to survive for a surprising high number of writes, but that can be a coincident
tl;dr: Buy high-end cards directly from the company which makes them.
early beta of mainline OpenWrt image is here in case you want to try: http://downloads.openwrt.org/snapshots/targets/mediatek/filogic/openwrt-mediatek-filogic-bananapi_bpi-r4-sdcard.img.gz
Hey Daniel,
This sounds like a really great solution. Will this work with the official U-Boot or will it require a custom build that includes all those features you mentioned - pcie, nvme, usb, uefi?
I would imagine having this as the main bootloader on the NAND storage, which then automatically boots from available sources, first usb, if connected, then nvme, lastly failsafe from NAND itself. Thus not requiring an active serial console.
Of course the usage of nvme, usb, failsafe and order should be configurable.
And then the option for booting from SD or emmc still remains via the dip switches.
I guess, when done tinkering around, then better move to Emmc.
Fixed images, was missing CONFIG_PHY_MTK_XFI_TPHY=y
So now the BPI-R4 is fully part of script. A different linux is installed, based on dangowrt’s mt7988-for-next branch, so not rolling-stable yet. But the linux package now is up-gradable (when I build a newer version, or you build one yourself).
Only AccessPoint version until now.
ALERT!!!
Upgrading systemd will break router function (disable ipforward)
See this post, how to fix:
Added network config option ‘router without sfp’ to build.sh script. Prebuild image follows in the next hour.
It only sets up lan and wan ports in nat (masquerading) setup. lan0 is setup as the wan port.
Network config fix for newest systemd-networkd is included.
Updated kernel from latest dangowrt’s mt7988-for-next branch, v6.10-next.
Hello Eric
is it possible to advise on my case please?
Got one of the ready images also used your script to create a new sdcard both AP and router but I cant set the interfaces up due to memory and apparently something is wrong with the system not recognizing the memory correctly
[root@bpir4 ~]# free -hm
total used free shared buff/cache available
Mem: 231Mi 165Mi 14Mi 684Ki 66Mi 66Mi
Swap: 0B 0B 0B
Also during boot there are sine services failing.
[**FAILED**] Failed to start **Setup MAC addresses**.
See 'systemctl status setmac.service' for details.
[**FAILED**] Failed to start **Netfilter Tables**.
See 'systemctl status nftables.service' for details.
[root@bpir4 ~]# ip link set wan up
[ 173.937409] ip: page allocation failure: order:10, mode:0x40dc0(GFP_KERNEL|__GFP_COMP|__GFP_ZERO), nodemask=(null),cpuset=/,mems_allowed=0
[ 173.949931] CPU: 2 UID: 0 PID: 3169 Comm: ip Not tainted 6.10.0-next-20240724-bpi #3
[ 173.957676] Hardware name: Banana Pi BPI-R4 (DT)
[ 173.962283] Call trace:
[ 173.964720] dump_backtrace+0xd4/0x110
[ 173.968468] show_stack+0x18/0x24
[ 173.971775] dump_stack_lvl+0x5c/0x7c
[ 173.975429] dump_stack+0x18/0x24
[ 173.978734] warn_alloc+0xdc/0x17c
[ 173.982129] __alloc_pages_noprof+0x3e4/0x940
[ 173.986477] __alloc_pages_node_noprof+0x78/0xac
[ 173.991084] ___kmalloc_large_node+0x68/0xb8
[ 173.995343] __kmalloc_noprof+0x3c/0x1d0
[ 173.999257] kmalloc_array_noprof.constprop.0+0x24/0x38
[ 174.004475] mtk_open+0x314/0x8e8
[ 174.007782] __dev_open+0x168/0x1b8
[ 174.011263] dev_open+0x20/0x6c
[ 174.014396] dsa_user_open+0x2c/0x94
[ 174.017962] __dev_open+0x168/0x1b8
[ 174.021442] __dev_change_flags+0x180/0x1a8
[ 174.025615] dev_change_flags+0x24/0x6c
[ 174.029442] do_setlink+0x55c/0xbb8
[ 174.032923] __rtnl_newlink+0x338/0x68c
[ 174.036748] rtnl_newlink+0x50/0x7c
[ 174.040225] rtnetlink_rcv_msg+0x27c/0x2d0
[ 174.044312] netlink_rcv_skb+0xa4/0x118
[ 174.048140] rtnetlink_rcv+0x18/0x24
[ 174.051707] netlink_unicast+0x12c/0x1c4
[ 174.055620] netlink_sendmsg+0x288/0x2e0
[ 174.059533] sock_sendmsg_nosec+0x1c/0x34
[ 174.063535] ____sys_sendmsg+0x1a4/0x248
[ 174.067449] ___sys_sendmsg+0x80/0xdc
[ 174.071099] __sys_sendmsg+0x6c/0xbc
[ 174.074664] __arm64_sys_sendmsg+0x20/0x2c
[ 174.078748] invoke_syscall+0x64/0xec
[ 174.082400] el0_svc_common+0xbc/0xd8
[ 174.086051] do_el0_svc+0x20/0x2c
[ 174.089355] el0_svc+0x70/0xa0
[ 174.092399] el0t_64_sync_handler+0x84/0x12c
[ 174.096659] el0t_64_sync+0x194/0x198
[ 174.100340] Mem-Info:
[ 174.102614] active_anon:124 inactive_anon:6114 isolated_anon:0
[ 174.102614] active_file:6208 inactive_file:5471 isolated_file:0
[ 174.102614] unevictable:0 dirty:136 writeback:173
[ 174.102614] slab_reclaimable:2789 slab_unreclaimable:7857
[ 174.102614] mapped:7268 shmem:171 pagetables:309
[ 174.102614] sec_pagetables:0 bounce:0
[ 174.102614] kernel_misc_reclaimable:0
[ 174.102614] free:8575 free_pcp:16 free_cma:0
[ 174.141179] Node 0 active_anon:500kB inactive_anon:24476kB active_file:24832kB inactive_file:21884kB unevictable:0kB isolated(anon):0kB isolated(file):0kB mapped:29120kB dirty:688kB writeback:692kB shmem:684kB writeback_tmp:0kB kernel_stack:1936kB pagetables:1236kB sec_pagetables:0kB all_unreclaimable? no
[ 174.168187] DMA free:34300kB boost:0kB min:1888kB low:2360kB high:2832kB reserved_highatomic:0KB active_anon:500kB inactive_anon:24424kB active_file:24728kB inactive_file:21884kB unevictable:0kB writepending:1380kB present:262144kB managed:237356kB mlocked:0kB bounce:0kB free_pcp:64kB local_pcp:0kB free_cma:0kB
[ 174.195829] lowmem_reserve[]: 0 0 0 0
[ 174.199493] DMA: 1019*4kB (UME) 573*8kB (UME) 249*16kB (UME) 150*32kB (UME) 74*64kB (UME) 30*128kB (UME) 16*256kB (UME) 4*512kB (UM) 1*1024kB (M) 1*2048kB (E) 0*4096kB = 35236kB
[ 174.215404] 11852 total pagecache pages
[ 174.219231] 0 pages in swap cache
[ 174.222534] Free swap = 0kB
[ 174.225413] Total swap = 0kB
[ 174.228282] 65536 pages RAM
[ 174.231064] 0 pages HighMem/MovableOnly
[ 174.234893] 6197 pages reserved
[ 174.238036] mt7530-mmio 15020000.switch wan: failed to open conduit eth0
RTNETLINK answers: Cannot allocate memory
Any help would be appreciated.
Thank you.
The last time I updated the linux for the R4 is a long time ago. It was a fork of dangowrt’s linux. I’ve been quite busy with other bpi-board related improvements.
You can build a new package:
git clone --branch=linux-bpir-git https://github.com/ericwoud/archlinuxarm-repo.git testlinux
cd testlinux
nano PKGBUILD
Change:
_gitroot="https://github.com/ericwoud/linux.git"
To:
_gitroot="https://github.com/dangowrt/linux.git"
TARGET=bpir4 makepkg
You can do this on a BPI (aarch64) board running archlinux , but also on x86_64 archlinux. If you have no archlinux, you could run it in a chroot. I would use tokland/arch-bootstrap
for that.
May have to add new CONFIG_XXX to defconfig, if there are new ones that apply to the R4.
Edit:
The prebuid package is being updated now. It is being build on the oracle aarch64 free-tier It should be enough to update the linux-bpir4-git package , available soon. Still not sure if there are new CONFIG_XXX
I type root, admin and it returns Access denied. I’m using bpir64-sdmmc-rt.img.gz. Do you know what I’m doing wrong? Thank you.
Hi,
This is the R4 version topic, but you mention R64 image. If about R64, please find the other topic.
Does it also happen with sd image?
I’ll see if I can build new images this weekend…
Or you can run sd image and use script on R64 to write to emmc a new version.
Edit:
Build process is running. Check the date of your image to see it is updated:
I tried the new img and I’m already logged in as root/admin. Very nice, thank you. Now I have a working R64 toy. And sorry for being in a different thread.