Unfortunately no one can be told what fun_plug is - you have to see it for yourself.
You are not logged in.
Hello,
I like to patch simple nags on the web interface, for example to remove the (strange) restriction to using special characters in password in /web/tools/admin.asp page.
I can do this by copying the entire web to disk, and changing the symbolic link. I would like to know if there is a simpler method, for example to change just that page and update it in the flash file system.
Kind regards,
Jaya
Offline
jayas wrote:
I would like to know if there is a simpler method, for example to change just that page and update it in the flash file system.
Updating the flash content is possible, like the fonz's fun_plug store-passwd.sh does to update the /etc/passwd and /etc/shadow files.
You need only to mount the right device and copy the updated asp file, i think.
Offline
Or another alternative is to copy the web stuff to disk and mount it over the existing folder, e.g: "cp -Rd /web/web /mnt/HD_a2/web && mount /mnt/HD_a2/web /web/web". I'm currently undecided about editing the pages in flash, I can't see too many problems with it other than possibly losing the changes each firmware update and possibly having issues with d-link re: warranty if you ever need to return the box... but you never know...
Offline
HaydnH wrote:
Or another alternative is to copy the web stuff to disk and mount it over the existing folder...
This was the first thing I did (see my original post) and I am looking for something better. I think Jules's suggestion is a good lead. I think I can work out where the image of web pages is stored in flash file system.
Jaya
Offline
Sorry - I miss read your post.
Having a [very] quick look, I doubt you'll be able to easily edit the webpages as they're stored as cramfs:
/ # ls /sys/crfs/web_page ChangeHD.asp error.asp login.asp temper.asp advanced formatHD main_menu.asp tools close_page.asp help non_HD.asp user css.css home relogin.asp version.asp debug.asp images status / # mount |grep /sys/crfs /dev/loop0 on /sys/crfs type cramfs (ro) / #
Offline
Hi HaydnH,
On my 1.04 firmware CRFS seems mounted differently to yours:
~ # mount | grep crfs /image.cfs on /sys/crfs type cramfs (rw,loop=/dev/loop0)
I can dump /image.cfs, work out how to patch it and rebuild a new image. I need to work out how to save the patched image to flash as /image.cfs. If warranty call is required I just have to restore the original image.
Regards
Jaya
Offline
hmmm... good point, cramfs is located in root, this seems possible as below BUT I haven't put the image back to see if this works - so I take NO RESPONSIBILITY blah blah blah - however I'd be interested to know the results!
From a linux box (10.8.0.1 is the vpn ip address of my nas box):
[root@localhost cramfs]$ scp 10.8.0.1:/image.cfs . root@10.8.0.1's password: image.cfs 100% 5276KB 23.6KB/s 03:44 [root@localhost cramfs]$ file image.cfs image.cfs.gz: Linux Compressed ROM File System data, little endian size 65536 CRC 0x9d5e2e18, edition 1571809397, 1395023733 blocks, -1147084280 files [root@localhost cramfs]# mount image.cfs /mnt -o loop [root@localhost cramfs]# mkdir out [root@localhost cramfs]# cd out/ [root@localhost out]# cp -Rd /mnt/* . [root@localhost out]# ls -al total 64 drwxr-xr-x 16 root root 4096 2008-02-05 14:54 . drwxrwxr-x 3 haydn haydn 4096 2008-02-05 14:54 .. drwxr-xr-x 2 root root 4096 2008-02-05 14:54 bin drwxr-xr-x 2 root root 4096 2008-02-05 14:54 codepages drwxr-xr-x 2 root root 4096 2008-02-05 14:54 default drwxr-xr-x 2 root root 4096 2008-02-05 14:54 etc_codepage drwxr-xr-x 2 root root 4096 2008-02-05 14:54 lib drwxr-xr-x 2 root root 4096 2008-02-05 14:54 lltd drwxr-xr-x 2 root root 4096 2008-02-05 14:54 LPRng drwxr-xr-x 2 root root 4096 2008-02-05 14:54 samba drwxr-xr-x 2 root root 4096 2008-02-05 14:54 sbin drwxr-xr-x 2 root root 4096 2008-02-05 14:54 scsi drwxr-xr-x 5 root root 4096 2008-02-05 14:54 shared_name drwxr-xr-x 2 root root 4096 2008-02-05 14:54 upnp drwxr-xr-x 2 root root 4096 2008-02-05 14:54 web drwxr-xr-x 10 root root 4096 2008-02-05 14:54 web_page [root@localhost out]# cd web_page/ [root@localhost web_page]# touch test [root@localhost web_page]# cd .. [root@localhost out]# mkfs.cramfs . ../test.img [root@localhost out]# cd .. [root@localhost cramfs]# ls -alh total 16M drwxrwxr-x 3 haydn haydn 4.0K 2008-02-05 14:57 . drwxrwxr-x 4 haydn haydn 4.0K 2008-02-05 14:31 .. -rw-r--r-- 1 haydn haydn 5.2M 2008-02-05 14:35 image.cfs -rw-r--r-- 1 haydn haydn 5.2M 2008-02-05 14:46 image.cfs.SAVE drwxr-xr-x 16 root root 4.0K 2008-02-05 14:54 out -rw-r--r-- 1 root root 5.2M 2008-02-05 14:57 test.img [root@localhost cramfs]# umount /mnt [root@localhost cramfs]# mount ./test.img /mnt -o loop [root@localhost cramfs]# cd /mnt/web_page/ [root@localhost web_page]# ls -lh test -rw-r--r-- 1 root root 0 1970-01-01 01:00 test [root@localhost web_page]#
Offline
hmmm: comparing the output of file before and after:
Before: Linux Compressed ROM File System data, little endian size 65536 CRC 0x9d5e2e18, edition 1571809397, 1395023733 blocks, -1147084280 files
Aftere: Linux Compressed ROM File System data, little endian size 5402624 version #2 sorted_dirs CRC 0xd093b27d, edition 0, 2926 blocks, 288 files
Looks like you may need to work out the arguments to mkfs.cramfs....
Offline