It worked!
Full of usual warnings - my 4Mb PSPboot non-wireless modem flash has >2Mb unused and my test modem has a working JTAG port, and this is a long post!. All commands below given and logged through serial console port + Hyperterminal.
1. Modify the mtd block arrangement to create mtd 5:
Code: Select all
From
(psbl) printenv
...
mtd4 0x90020000,0x90400000
mtd0 0x90096000,0x90400000
...
Commands typed in
(psbl) setenv mtd0 0x90096000,0x903F0000
(psbl) setenv mtd5 0x903F0000,0x90400000
(psbl) setenv mtd4 0x90020000,0x903F0000
to
(psbl) printenv
...
mtd0 0x90096000,0x903F0000
mtd5 0x903F0000,0x90400000
mtd4 0x90020000,0x903F0000
Reboot and new partition automatomatically recognized
Code: Select all
(psbl) boot
Booting...
Copyright (C) 2006 Merlion-ACORP Russia Software Company.
Launching kernel LZMA decompressor.
Kernel decompressor was successful ... launching kernel.
...
Looking for mtd device :mtd5:
Found a mtd5 image (0x3f0000), with size (0x10000).
Creating 1 MTD partitions on "Physically mapped flash:0":
0x003f0000-0x00400000 : "mtd5"
Looking for mtd device :mtd6:
...
Create a new temp directory and fill with various files copied from elsewhere on modem
Code: Select all
/var # cp /usr/local/sbin/* nvramdir/
/var # cp tmp/* nvramdir/
...
/var # ls -laF nvramdir
drwxr-xr-x 1 0 0 0 Feb 27 14:50 ./
drwxr-xr-x 1 0 0 0 Feb 27 14:48 ../
-rw-r--r-- 1 0 0 20 Apr 11 21:19 TZ
-rw-r--r-- 1 0 0 58 Apr 11 21:19 bfilter_br0_mac
-rw-r--r-- 1 0 0 58 Apr 11 21:19 bfilter_br1_mac
-rw-r--r-- 1 0 0 58 Apr 11 21:19 bfilter_br2_mac
-rw-r--r-- 1 0 0 58 Apr 11 21:19 bridge_br0_mac
-rw-r--r-- 1 0 0 58 Apr 11 21:19 bridge_br1_mac
-rw-r--r-- 1 0 0 58 Apr 11 21:19 bridge_br2_mac
srwxr-xr-x 1 0 0 0 Apr 11 21:19 cm_logic.ctl=
srwxr-xr-x 1 0 0 0 Apr 11 21:19 cm_pc.ctl=
srwxr-xr-x 1 0 0 0 Apr 11 21:19 cm_webcm.ctl=
-rwxr-xr-x 1 0 0 2541 Apr 11 21:18 container-drv.sh*
-rwxr-xr-x 1 0 0 325 Apr 11 21:18 container-start.sh*
-rwxr-xr-x 1 0 0 229 Apr 11 21:18 create.sh*
-rwxr-xr-x 1 0 0 229 Apr 11 21:18 delete.sh*
-rwxr-xr-x 1 0 0 260 Apr 11 21:18 desc.sh*
-rwxr-xr-x 1 0 0 222 Apr 11 21:18 free_handle.sh*
-rwxr-xr-x 1 0 0 851 Apr 11 21:18 fw_advanced_security_start_test.sh*
-rwxr-xr-x 1 0 0 323 Apr 11 21:18 fw_advanced_security_stop_test.sh*
-rwxr-xr-x 1 0 0 4642 Apr 11 21:18 fw_functions.sh*
-rwxr-xr-x 1 0 0 305 Apr 11 21:18 fw_port_forwarding_start_test.sh*
-rwxr-xr-x 1 0 0 591 Apr 11 21:18 fw_rules.sh*
-rw-r--r-- 1 0 0 0 Apr 11 21:19 gateways
-rwxr-xr-x 1 0 0 191 Apr 11 21:18 group_begin.sh*
-rwxr-xr-x 1 0 0 189 Apr 11 21:18 group_end.sh*
-rw-r--r-- 1 0 0 49 Apr 11 21:19 hosts
-rw-r--r-- 1 0 0 41 Apr 11 21:19 landhcps0.leases
-rw-r--r-- 1 0 0 9 Apr 11 21:19 led.cfg
-rw-r--r-- 1 0 0 3909 Apr 11 21:19 led.conf
-rw-r--r-- 1 0 0 18 Apr 11 21:19 maca
-rw-r--r-- 1 0 0 18 Apr 11 21:19 macc
-rwxr-xr-x 1 0 0 3018 Apr 11 21:18 mgr_functions.sh*
-rwxr-xr-x 1 0 0 908 Apr 11 21:18 mgr_test.sh*
-rwxr-xr-x 1 0 0 174 Apr 11 21:18 new_handle.sh*
-rw-r--r-- 1 0 0 29 Apr 11 21:19 passwd
-rw-r--r-- 1 0 0 216 Apr 11 21:19 pppHBdefault.conf
-rw-r--r-- 1 0 0 0 Apr 11 21:19 pppHBdhcp.leases
-rwxr-xr-x 1 0 0 146 Apr 11 21:18 pppoa-create.sh*
-rwxr-xr-x 1 0 0 146 Apr 11 21:18 pppoe-create.sh*
-rw-r--r-- 1 0 0 1283 Apr 11 21:19 profile
-rwxr-xr-x 1 0 0 256 Apr 11 21:18 pvc_vci.sh*
-rwxr-xr-x 1 0 0 256 Apr 11 21:18 pvc_vpi.sh*
-rw-r--r-- 1 0 0 50 Apr 11 21:19 resolv.conf
-rwxr-xr-x 1 0 0 614 Apr 11 21:18 route_add.sh*
-rwxr-xr-x 1 0 0 500 Apr 11 21:18 route_del.sh*
-rw-r--r-- 1 0 0 51 Apr 11 21:19 shadow
-rwxr-xr-x 1 0 0 170 Apr 11 21:18 static-create.sh*
-rwxr-xr-x 1 0 0 5832 Apr 11 21:19 test.sh*
-rwxr-xr-x 1 0 0 253 Apr 11 21:18 type.sh*
-rw-r--r-- 1 0 0 210 Apr 11 21:19 udhcpd.conf
-rw-r--r-- 1 0 0 44 Apr 11 21:19 udhcpd.delta
create tarball, nb only real files compressed
Code: Select all
/var # tar -cz -f nvramdir.tgz nvramdir/*
tar: nvramdir/cm_webcm.ctl: socket ignored
tar: nvramdir/cm_pc.ctl: socket ignored
tar: nvramdir/cm_logic.ctl: socket ignored
/var # ls -laF
drwxr-xr-x 1 0 0 0 Feb 27 14:48 ./
drwxr-xr-x 10 0 0 99 Feb 27 14:49 ../
drwxr-xr-x 1 0 0 0 Feb 27 14:44 cache/
drwxr-xr-x 1 0 0 0 Feb 27 14:44 dev/
drwxr-xr-x 1 0 0 0 Feb 27 14:44 flash/
drwxr-xr-x 1 0 0 0 Feb 27 14:44 lib/
drwxr-xr-x 1 0 0 0 Feb 27 14:44 lock/
drwxr-xr-x 1 0 0 0 Feb 27 14:44 log/
drwxr-xr-x 1 0 0 0 Feb 27 14:50 nvramdir/
-rw-r--r-- 1 0 0 6890 Apr 11 21:25 nvramdir.tgz
drwxr-xr-x 1 0 0 0 Feb 27 14:44 proc/
drwxr-xr-x 1 0 0 0 Feb 27 14:44 run/
drwxr-xr-x 1 0 0 0 Feb 27 14:49 spool/
drwxr-xr-x 1 0 0 0 Feb 27 14:49 tmp/
-rwxr-xr-x 1 0 0 55688 Feb 27 14:48 upgrader*
drwxr-xr-x 1 0 0 0 Feb 27 14:48 var/
Save tarball to flash and reboot to see if it is still there...
Code: Select all
cp nvramdir.tgz /dev/mtdblock/5
...
/var # reboot
Restarting system.
Convert flash mtd block to a a file and check contents
Code: Select all
/var # dd if=/dev/mtdblock/5 of=/var/test2.tgz
128+0 records in
128+0 records out
/var # tar -tz -f test2.tgz
nvramdir/udhcpd.delta
nvramdir/udhcpd.conf
nvramdir/type.sh
nvramdir/test.sh
nvramdir/static-create.sh
nvramdir/shadow
nvramdir/route_del.sh
nvramdir/route_add.sh
nvramdir/resolv.conf
nvramdir/pvc_vpi.sh
nvramdir/pvc_vci.sh
nvramdir/profile
nvramdir/pppoe-create.sh
nvramdir/pppoa-create.sh
nvramdir/pppHBdhcp.leases
nvramdir/pppHBdefault.conf
nvramdir/passwd
nvramdir/new_handle.sh
nvramdir/mgr_test.sh
nvramdir/mgr_functions.sh
nvramdir/macc
nvramdir/maca
nvramdir/led.conf
nvramdir/led.cfg
nvramdir/landhcps0.leases
nvramdir/hosts
nvramdir/group_end.sh
nvramdir/group_begin.sh
nvramdir/gateways
nvramdir/fw_rules.sh
nvramdir/fw_port_forwarding_start_test.sh
nvramdir/fw_functions.sh
nvramdir/fw_advanced_security_stop_test.sh
nvramdir/fw_advanced_security_start_test.sh
nvramdir/free_handle.sh
nvramdir/desc.sh
nvramdir/delete.sh
nvramdir/create.sh
nvramdir/container-start.sh
nvramdir/container-drv.sh
nvramdir/bridge_br2_mac
nvramdir/bridge_br1_mac
nvramdir/bridge_br0_mac
nvramdir/bfilter_br2_mac
nvramdir/bfilter_br1_mac
nvramdir/bfilter_br0_mac
nvramdir/TZ
/var # ls -laF
...
-rw-r--r-- 1 0 0 65536 Apr 11 21:31 test2.tgz
...
extract tarball and check contents - note properties preserved
Code: Select all
/var # tar -xz -f test2.tgz
/var # ls -laF nvramdir
drwxr-xr-x 1 0 0 0 Apr 11 21:33 ./
drwxr-xr-x 1 0 0 0 Feb 27 14:48 ../
-rw-r--r-- 1 0 0 20 Apr 11 21:19 TZ
-rw-r--r-- 1 0 0 58 Apr 11 21:19 bfilter_br0_mac
-rw-r--r-- 1 0 0 58 Apr 11 21:19 bfilter_br1_mac
-rw-r--r-- 1 0 0 58 Apr 11 21:19 bfilter_br2_mac
-rw-r--r-- 1 0 0 58 Apr 11 21:19 bridge_br0_mac
-rw-r--r-- 1 0 0 58 Apr 11 21:19 bridge_br1_mac
-rw-r--r-- 1 0 0 58 Apr 11 21:19 bridge_br2_mac
-rwxr-xr-x 1 0 0 2541 Apr 11 21:18 container-drv.sh*
-rwxr-xr-x 1 0 0 325 Apr 11 21:18 container-start.sh*
-rwxr-xr-x 1 0 0 229 Apr 11 21:18 create.sh*
-rwxr-xr-x 1 0 0 229 Apr 11 21:18 delete.sh*
-rwxr-xr-x 1 0 0 260 Apr 11 21:18 desc.sh*
-rwxr-xr-x 1 0 0 222 Apr 11 21:18 free_handle.sh*
-rwxr-xr-x 1 0 0 851 Apr 11 21:18 fw_advanced_security_start_test.sh*
-rwxr-xr-x 1 0 0 323 Apr 11 21:18 fw_advanced_security_stop_test.sh*
-rwxr-xr-x 1 0 0 4642 Apr 11 21:18 fw_functions.sh*
-rwxr-xr-x 1 0 0 305 Apr 11 21:18 fw_port_forwarding_start_test.sh*
-rwxr-xr-x 1 0 0 591 Apr 11 21:18 fw_rules.sh*
-rw-r--r-- 1 0 0 0 Apr 11 21:19 gateways
-rwxr-xr-x 1 0 0 191 Apr 11 21:18 group_begin.sh*
-rwxr-xr-x 1 0 0 189 Apr 11 21:18 group_end.sh*
-rw-r--r-- 1 0 0 49 Apr 11 21:19 hosts
-rw-r--r-- 1 0 0 41 Apr 11 21:19 landhcps0.leases
-rw-r--r-- 1 0 0 9 Apr 11 21:19 led.cfg
-rw-r--r-- 1 0 0 3909 Apr 11 21:19 led.conf
-rw-r--r-- 1 0 0 18 Apr 11 21:19 maca
-rw-r--r-- 1 0 0 18 Apr 11 21:19 macc
-rwxr-xr-x 1 0 0 3018 Apr 11 21:18 mgr_functions.sh*
-rwxr-xr-x 1 0 0 908 Apr 11 21:18 mgr_test.sh*
-rwxr-xr-x 1 0 0 174 Apr 11 21:18 new_handle.sh*
-rw-r--r-- 1 0 0 29 Apr 11 21:19 passwd
-rw-r--r-- 1 0 0 216 Apr 11 21:19 pppHBdefault.conf
-rw-r--r-- 1 0 0 0 Apr 11 21:19 pppHBdhcp.leases
-rwxr-xr-x 1 0 0 146 Apr 11 21:18 pppoa-create.sh*
-rwxr-xr-x 1 0 0 146 Apr 11 21:18 pppoe-create.sh*
-rw-r--r-- 1 0 0 1283 Apr 11 21:19 profile
-rwxr-xr-x 1 0 0 256 Apr 11 21:18 pvc_vci.sh*
-rwxr-xr-x 1 0 0 256 Apr 11 21:18 pvc_vpi.sh*
-rw-r--r-- 1 0 0 50 Apr 11 21:19 resolv.conf
-rwxr-xr-x 1 0 0 614 Apr 11 21:18 route_add.sh*
-rwxr-xr-x 1 0 0 500 Apr 11 21:18 route_del.sh*
-rw-r--r-- 1 0 0 51 Apr 11 21:19 shadow
-rwxr-xr-x 1 0 0 170 Apr 11 21:18 static-create.sh*
-rwxr-xr-x 1 0 0 5832 Apr 11 21:19 test.sh*
-rwxr-xr-x 1 0 0 253 Apr 11 21:18 type.sh*
-rw-r--r-- 1 0 0 210 Apr 11 21:19 udhcpd.conf
-rw-r--r-- 1 0 0 44 Apr 11 21:19 udhcpd.delta
So I now have a non volatile storage area on my modem: - I need to create a couple of simple batch files. The storage to nvram must be manual (create, copy, delete tarball), but the recovery on every boot can be via autoexec functions (dd,untar,delete). The expanded size of the memory block is 64k in this example, so need at least double this ram spare at boot to be able to extract files.
And back to the OP it is possible with RT2.2 firmware, at least if you have similar modem to mine with 4Mb flash pspboot 16Mb ram... Hope this is of some use!