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

Custom L7 Patterns where/how to include them

Discussion in 'Tomato Firmware' started by waeking, Aug 5, 2012.

  1. waeking

    waeking Networkin' Nut Member

    I am trying to create a custom l7 pattern to see if it works. The correct place is in /rom/etc/l7-protocols. however I can't add a file to this directory as it is ready only.

    I can copy the existing l7-patterns to /opt/l7-patterns. then

    if [ -d /mnt/tomato ]; then
    mount -o bind /mnt/tomato/opt /opt
    rm -rf /etc/l7-protocols
    ln -s /opt/etc/l7-protocols /etc/l7-protocols
    fi

    this works for now. However. how do i restart the qos. as it loads before the usb stick does? Or is there a better way?
     
  2. Porter

    Porter LI Guru Member

    As far as I remember instead of an usb-stick I used JFFS. It's under Administration/JFFS. Btw: I didn't delete the source directory for the protocols, because if I did screw anything up, I would have had to reflash the router. I think I just set up a new symlink.
     
  3. waeking

    waeking Networkin' Nut Member

    the rm command is just removing the symblic link to /rom/etc/l7-protocols....

    how did you get the l7-protocols to load off of the jffs partition?
     
  4. Porter

    Porter LI Guru Member

    Ok, didn't read thoroughly enough. But you already did everything right. I copied the protocols to /jffs and then replaced the link you removed by one that points to the directory on the jffs-partition. It's just the same like you did with the usb-stick.
     
  5. shibby20

    shibby20 Network Guru Member

    /etc is a symlink to /tmp/etc well it`s writable. You can just copy files to /etc/l7-protocols/ directory.
     
  6. waeking

    waeking Networkin' Nut Member

    if [ -d /mnt/tomato ]; then
    mount -o bind /mnt/tomato/opt /opt
    cp /opt/etc/l7-protocols/*.pat /etc/l7-protocols/
    fi

    I still need a line to restart the qos after the copy has taken place.
     
  7. shibby20

    shibby20 Network Guru Member

    try
    service qos restart
     
  8. waeking

    waeking Networkin' Nut Member

    ok just rebooted to see if the copy command suggested would work. turns out that /etc/l7-protocols -> /rom/etc/l7-protocols/ therefore a readonly filesystem. I cannot get that to work. any other ideas?

    I tried to cp to /tmp/etc/l7-protocols. but same readonly filesystem.

    EDIT: I should add that restarting the qos was not necessary.
     
  9. Porter

    Porter LI Guru Member

    Then I'm still voting for the jffs solution. If the new link pointing to the directory on the jffs partition doesn't stick through a reboot set a new link via Administration/Scripts/Init.
     
  10. shibby20

    shibby20 Network Guru Member

    ok, you have right. /etc/l7-protocols is a symplin to /rom/... (read-only) but /etc is writable (is a symplink to /tmp/etc) well you can just remove symlink of l7-protocols and make own:

    rm /etc/l7-protocols
    ln -s /jffs/own-protocols /etc/l7-protocols

    Best Regards
     

Share This Page