[bpi-r3-mini] install to nand from emmc openwrt fails with mtd permission error

Hi :slight_smile:

Following the steps described in the board support commit, I installed Openwrt to the emmc of a fresh bpi-r3-mini.
That works in general (except the overlay is lost on sysupgrade) but I'd prefer storing it on the NAND.

This is what happens when I try to do the first step of the installation:

$ mtd write /tmp/openwrt-*-bananapi_bpi-r3-mini-snand-preloader.bin /dev/mtd0
Could not open mtd device: /dev/mtd0
Can't open device for writing!

I was able to work around it by doing this:

diff --git a/target/linux/mediatek/dts/mt7986a-bananapi-bpi-r3-mini.dts b/target/linux/mediatek/dts/mt7986a-bananapi-bpi-r3-mini.dts
index 09a557c0cb..c89f199575 100644
--- a/target/linux/mediatek/dts/mt7986a-bananapi-bpi-r3-mini.dts
+++ b/target/linux/mediatek/dts/mt7986a-bananapi-bpi-r3-mini.dts
@@ -523,7 +523,7 @@
                        partition@0 {
                                label = "bl2";
                                reg = <0x0 0x200000>;
-                               read-only;
+                               //read-only;
                        };
 
                        partition@200000 {

But that's clearly not what's described in the commit.
Is there something that I'm missing?

I just ordered such a device, so I'm very much interested in it. Looks like the read-only flag was there ever since the commit was made, so the instructions are maybe not entirely correct. Unfortunately, you can't just change a commit message.

The "usual" way to work around this is installing kmod-mtd-rw and loading the module with insmod /lib/modules/$(uname -r)/mtd-rw.ko i_want_a_brick=1. This enables write support for all locked partitions.

1 Like