Using the @hnyman master-r7360 build scripts I modified the flash memory partitions and built a new firmware. Created a 7MB read/write "jffs" partition to replace the read-only "reserve" one.
root@R7800RT1:~# cat /etc/banner|grep Open
OpenWrt SNAPSHOT, r7374-afac2a2
root@R7800RT1:~# uname -mrvos
Linux 4.14.52 #0 SMP Tue Jul 3 05:24:45 2018 armv7l GNU/Linux
root@R7800RT1:~# dmesg|grep '\-0x000'
[ 1.062422] 0x000000000000-0x000000c80000 : "qcadata"
[ 1.089929] 0x000000c80000-0x000001180000 : "APPSBL"
[ 1.099241] 0x000001180000-0x000001200000 : "APPSBLENV"
[ 1.100870] 0x000001200000-0x000001340000 : "art"
[ 1.106208] 0x000001340000-0x000001480000 : "artbak"
[ 1.110986] 0x000001480000-0x000001880000 : "kernel"
[ 1.120740] 0x000001880000-0x000007900000 : "ubi"
[ 1.286099] 0x000007900000-0x000008000000 : "jffs" <-- Replaces the old "reserve"
root@R7800RT1:~# cat /proc/mtd
dev: size erasesize name
mtd0: 00c80000 00020000 "qcadata"
mtd1: 00500000 00020000 "APPSBL"
mtd2: 00080000 00020000 "APPSBLENV"
mtd3: 00140000 00020000 "art"
mtd4: 00140000 00020000 "artbak"
mtd5: 00400000 00020000 "kernel"
mtd6: 06080000 00020000 "ubi"
mtd7: 00700000 00020000 "jffs"
update opkg and prepare to install a package:
root@R7800RT1:~# opkg update
Downloading http://downloads.openwrt.org/snapshots/targets/ipq806x/generic/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_core
Downloading http://downloads.openwrt.org/snapshots/targets/ipq806x/generic/packages/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/base/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_base
Downloading http://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/base/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/luci/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_luci
Downloading http://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/luci/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_packages
Downloading http://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/packages/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/routing/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_routing
Downloading http://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/routing/Packages.sig
Signature check passed.
Downloading http://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/telephony/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_telephony
Downloading http://downloads.openwrt.org/snapshots/packages/arm_cortex-a15_neon-vfpv4/telephony/Packages.sig
Signature check passed.
Install the nand-utils package:
root@R7800RT1:~# opkg install nand-utils
Installing nand-utils (2.0.2-1) to root...
Downloading http://downloads.openwrt.org/snapshots/targets/ipq806x/generic/packages/nand-utils_2.0.2-1_arm_cortex-a15_neon-vfpv4.ipk
Configuring nand-utils.
Perform an erase and a jffs2 format of the mtd7 partition:
root@R7800RT1:~# flash_erase -j /dev/mtd7 0 0
Erasing 128 Kibyte @ 0 -- 0 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 20000 -- 1 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 40000 -- 3 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 60000 -- 5 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 80000 -- 7 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ a0000 -- 8 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ c0000 -- 10 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ e0000 -- 12 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 100000 -- 14 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 120000 -- 16 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 140000 -- 17 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 160000 -- 19 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 180000 -- 21 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 1a0000 -- 23 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 1c0000 -- 25 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 1e0000 -- 26 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 200000 -- 28 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 220000 -- 30 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 240000 -- 32 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 260000 -- 33 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 280000 -- 35 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 2a0000 -- 37 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 2c0000 -- 39 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 2e0000 -- 41 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 300000 -- 42 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 320000 -- 44 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 340000 -- 46 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 360000 -- 48 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 380000 -- 50 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 3a0000 -- 51 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 3c0000 -- 53 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 3e0000 -- 55 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 400000 -- 57 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 420000 -- 58 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 440000 -- 60 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 460000 -- 62 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 480000 -- 64 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 4a0000 -- 66 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 4c0000 -- 67 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 4e0000 -- 69 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 500000 -- 71 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 520000 -- 73 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 540000 -- 75 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 560000 -- 76 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 580000 -- 78 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 5a0000 -- 80 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 5c0000 -- 82 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 5e0000 -- 83 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 600000 -- 85 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 620000 -- 87 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 640000 -- 89 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 660000 -- 91 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 680000 -- 92 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 6a0000 -- 94 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 6c0000 -- 96 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 6e0000 -- 98 % complete flash_erase: Cleanmarker Updated.
Erasing 128 Kibyte @ 6e0000 -- 100 % complete
Create a mount point for the partition:
root@R7800RT1:~# mkdir /jffs
Mount the partition block device:
root@R7800RT1:~# mount -t jffs2 /dev/mtdblock7 /jffs
Display size of /jffs:
root@R7800RT1:~# df -h /jffs
Filesystem Size Used Available Use% Mounted on
/dev/mtdblock7 7.0M 516.0K 6.5M 7% /jffs
Create and store a file on /jffs:
root@R7800RT1:~# echo 'Hello World!!!' > /jffs/helloworld.txt
root@R7800RT1:~# ls -l /jffs
-rw-r--r-- 1 root root 15 Jul 3 04:18 helloworld.txt
root@R7800RT1:~# cat /jffs/helloworld.txt
Hello World!!!
Copy the file to root's directory (/root) and preserve attributes:
root@R7800RT1:~# cp -a /jffs/helloworld.txt .
root@R7800RT1:~# ls -l
-rw-r--r-- 1 root root 15 Jul 3 04:18 helloworld.txt
Make the following changes to the original qcom-ipq8065-r7800.dts:
jffs@7900000 {
label = "jffs";
reg = <0x7900000 0x0700000>;
/* read-only;
* experimental
* mtd7
*/
};
This was a lot of work for a measly 7MB. May not be worth doing!!