hello master of tomato, i'm noob in tomato, i would like to know how to change look and feel tomato web interface with custom css i made
Just name your CSS file custom.css and put it in the following directory.
Then in the GUI go to:
(Administration > Admin Access) and change Color Scheme to Custom (ext/custom.css)
Also place any images you use for your theme in the same directory.
VERY IMPORTANT!!! Make a back-up of your CSS because since the CSS file is stored in a tmp folder, everytime the router reboots or loses power, the CSS file goes bye bye.
I personally have my custom CSS stored on a usb stick attached to the router and I have an init script that copies it back to that tmp directory when the router boots back up. This way I never really lose my theme.
The flash is divided into logical segments. Do "cat /proc/mtd" to see them. Best is to look for what the kernel prints out at bootup—-see the dmesg or syslog. Here's mine (WL-520GU)
Amd/Fujitsu Extended Query Table v1.1 at 0x0040
Flash Id: Vendor: 0x00c2 Device: 0x00a8
number of CFI chips: 1
cfi_cmdset_0002: Disabling fast programming due to code brokenness.
Flash device: 0x400000 at 0x1c000000
Creating 5 MTD partitions on "Physically mapped flash":
0x00000000-0x00020000 : "pmon"
0x00020000-0x003f0000 : "linux"
0x0009cc00-0x00370000 : "rootfs"
0x00370000-0x003f0000 : "jffs2"
0x003f0000-0x00400000 : "nvram"
Also….the flash chip internal quantum is Erase Blocks of 64kb. The logical segment "nvram" is by definition at the end of the flash, and is one EB (it cannot be less than 1 EB). But, the firmware will only use half of that EB for the nvram. No particular reason that I see, that's just the way they did it.
That's the 32K that nvram show displays.
Or you could execute this command once:
nvram setfile2nvram "/tmp/var/wwwext/custom.css"
The file(s) saved to nvram this way will get automatically restored at bootup.
Well I do mine the way I do because I have image files I've created to go along with my theme. I didn't think you could save an image file in to nvram… Can you..?
ray123, interesting. My rtn-16 dmesg shows:
Flash device: 0x2000000 at 0x1c000000 Creating 5 MTD partitions on "Physically mapped flash": 0x00000000-0x00040000 : "pmon" 0x00040000-0x01fe0000 : "linux" 0x00118800-0x007a0000 : "rootfs" 0x007a0000-0x01fe0000 : "jffs2" 0x01fe0000-0x02000000 : "nvram"
and cat /proc/mtd shows:
dev: size erasesize name mtd0: 00040000 00020000 "pmon" mtd1: 01fa0000 00020000 "linux" mtd2: 00687800 00020000 "rootfs" mtd3: 01840000 00020000 "jffs2" mtd4: 00020000 00020000 "nvram"
So my erasesize is 128K and yet nvram is still only 32K. Seems rather a waste.
Lassik, not really meaning to hijack your thread. Was trying to get at how much nvram one has to store files in it like your css. I don't see why you could not store image files too other than space issues. But also don't see a benefit if you can easily store elsewhere as you are doing.
Any files - including images - can be saved to nvram using setfile2nvram command - the only issue would be the space. This feature was mainly intended to store some small configuration files (like /etc/fstab and such). To prevent you from quickly running out of nvram space, there's a hardcoded size limit for files that can be stored this way - it's set to 4 KB. Most images would be larger than that.
So for storing custom themes with images, using the usb storage space or a folder on jffs partition seems to be the best option. You don't even need to copy the files from jffs/usb to wwwext directory - you can just use "mount -o bind" command to mount your folder with theme files on /tmp/var/wwwext.