1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How do you use JFFS2 to apply a custom theme?

Discussion in 'Tomato Firmware' started by tmr250z, Feb 26, 2009.

  1. tmr250z

    tmr250z LI Guru Member

    OK, so I have been using Tomato firmware on my WRT45GL router for about a year. It has worked out really well and I definitely prefer it over the default firmware. But in the whole time that I have been using it, I haven't really looked into using any the advanced features it offers until recently. I've set up a share folder on my computer that I have been saving my bandwidth logs to using CIFS for a little over 3 three months and I'm happy with that.

    A couple of days a go, I saw a custom theme here that I think is excellent and I started using it by following the instructions in the first post of that thread. Using CIFS is fine until you reboot the router and it goes back to the original theme. I wanted to find out how to apply the theme in a more permanent way, so later in that thread, I saw something about using JFFS2. I understand basically what it is, but I am unsure how exactly I would go about using it. So could someone give me step-by-step newbie instructions on how to apply the above theme to Tomato using JFFS2 that will survive through reboots?
     
  2. occamsrazor

    occamsrazor Network Guru Member

    See posts #21, #28, #29 on the link you gave... You need to copy the files to the JFFS partition using e.g. WinSCP, then put the script in post #28:

    Code:
    mkdir /var/wwwext
    sleep 5
    cp /jffs/custom.css /var/wwwext/custom.css
    sleep 5
    cp /jffs/tomato.png /var/wwwext/tomato.png
    sleep
    cp /jffs/bg.png /var/wwwext/bg.png
    sleep
    
    in your init script. Go to Administration > Admin Access > Color Scheme > choose "Custom" and reboot the router.
     
  3. stroths

    stroths Addicted to LI Member

    I was personally having issues where the jffs wasn't being mounted before the init script would run. I knew I could put it on the wan up script, but decided to try a different option. I made a directory called wwwext in my jffs directory (/jffs/wwwext) and copied all my theme files there. Next I added the lines below to my init script.

    Code:
    mv /var/wwwext /var/wwwext.old
    sleep 1
    ln -s /jffs/wwwext /var
    This makes a symbolic link in my /var directory for the wwwext directory. Therefore, even if my jffs isn't mounted before this command runs it won't cause an issue because it should be mounted before I pull up the web interface.
     
  4. Low-WRT

    Low-WRT LI Guru Member

    You could also do something like:

    Code:
    sleep 30
    mkdir /var/wwwext
    sleep 5
    cp /jffs/custom.css /var/wwwext/custom.css
    sleep 5
    cp /jffs/tomato.png /var/wwwext/tomato.png
    sleep
    cp /jffs/bg.png /var/wwwext/bg.png
    sleep
    That way, the init script waits 30 sec before running. I had to do this with a wds router...My init script was running before the remote cifs client had a chance to mount.
     
  5. tmr250z

    tmr250z LI Guru Member

    Thanks for replying guys.

    I understand everything except the WinSCP part. It a FTP client, right? I've never used it before. How exactly do I use it to copy the files to the JFFS partition?
     
  6. stroths

    stroths Addicted to LI Member

    The interface of WinSCP is similar to a FTP client, but its connected via SSH. You will want to make sure you have SSH enabled on your router as well as jffs. Use WinSCP to connect to your router and copy files over just like you would in a FTP client.
     
  7. Beftus

    Beftus Network Guru Member

    I pasted the CIFS script below in the Firewall tab, now the theme survives a reboot as long as the pc containing the shared folder is up and running.

    Code:
    mkdir /var/wwwext
    cp /cifs2/custom.css /var/wwwext/custom.css
    cp /cifs2/bg.png /var/wwwext/bg.png
     
  8. tmr250z

    tmr250z LI Guru Member

    Thanks for the assistance everyone, I have it working now. :)

    But when I logged into the router using WinSCP, I received this error:

    [​IMG]

    What does it mean, should I be worried?
     
  9. danix71

    danix71 LI Guru Member


    Ignore this message and go ahead.
     
  10. tmr250z

    tmr250z LI Guru Member

    I've done it. I copied files to the JFFS partition, saved the script, selected custom theme and rebooted. It now survives when the router is rebooted. I'm a happy camper now. :)

    Thanks once again everyone.
     

Share This Page