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.
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.
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).
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.
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 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.
One is always free to implement a initrd of one’s choice.
I’ m working on a much more functional, more tailor suited, initrd, with many possibilities For now it is running on R3, but when all functional I will add R4.
Just a few things working on:
Uboot Distro-boot sd/emmc - nvme - nand. Scanning for extlinux.conf on the devices in that order. Where on nand there is also a resque initrd.
This initrd can make connection through dhcp-client. Run my installscript or debootstrap, to install any linux on the R3 directly from initrd.
Anyway, still in development, partly functional. Maybe in a month or so it is usable.