Page 1 of 2 12 LastLast
Results 1 to 15 of 958

Thread: [HowTo] Install and configure Oleg's firmware

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2005
    Location
    Germany - Frankfurt
    Posts
    1,548
    12a. original SAMBA
    Samba will show your local HDD in the windows network.
    oleg integrated a good working samba version from firmware -9 on.
    You activate it in the web interface USB Application -> Samba.

    Simply choose "All partitions" for Samba File Shares and a Default Access Level of "read/write".
    Do not forget to enter your hostname and workgroup.

    12b. IPKG SAMBA
    I recommend using samba as in the chapter above. This chapter is for the advanced users who want more flexibility.
    Samba has to be disabled in the webinterface!

    Code:
    ipkg install xinetd
    ipkg install samba2
    You have to change /opt/etc/init.d/S10xinetd to work with the start|stop feature of rc.unslung.
    Code:
    vi /opt/etc/init.d/S10xinetd
    content:
    Code:
    #! /bin/sh
    #
    # Startup script for xinetd
    #
    prefix=/opt
    sbindir=${prefix}/sbin
    
    NAME=xinetd
    DAEMON=${sbindir}/${NAME}
    DESC="xinetd"
    PIDFILE="/var/run/xinetd.pid"
    OPTIONS="-pidfile $PIDFILE"
    CONFDIR="/opt/etc/xinetd.d"
    
    # installation check
    test -x ${DAEMON} || exit 0
    
    case "$1" in
        start)
            if [ -z "`pidof ${NAME}`" ] ; then
                printf "Starting ${DESC}: "
                ${DAEMON} ${OPTIONS}
                printf "${NAME}.\n"
            fi
        ;;
        stop)
            if [ -n "`pidof ${NAME}`" ]; then
              printf "Stopping ${DESC}: "
              kill -SIGTERM `cat $PIDFILE`
              printf "${NAME}.\n"
              for i in ${CONFDIR}/* ; do
                if [ -n "`grep "^[[:space:]]*disable[[:space:]]*=[[:space:]]*no" ${i}`" ] ; then
                  daemon="`basename $(awk -F= '/^[[:space:]]*server[[:space:]]*=[[:space:]]*.*/{print $2}' ${i})`"
                  printf "Stopping ${daemon}: "
                  kill "`pidof ${daemon}`" > /dev/null 2>&1
                  printf "${daemon}.\n"
                fi
              done
            fi
        ;;
        reload|reconfigure)
            if [ -n "`pidof ${NAME}`" ]; then
                printf "Reloading ${DESC}: "
                kill -SIGHUP `cat $PIDFILE`
                printf "${NAME}.\n"
            fi
        ;;
        restart|force-reload)
            $0 stop
            sleep 1
            $0 start
        ;;
        *)
            printf "Usage: $0 {start|stop|reload|reconfigure|restart|force-reload}\n" >&2
            exit
        ;;
    esac
    
    exit 0
    To make this clear: Stopping xinetd will stop all registered services. Restarting xinetd will stop all services and start only xinetd itself.

    Edit the conf for swat:
    Code:
    vi /opt/etc/xinetd.d/swat
    You should cutomize the IP settings as you need them and exchange "user = root" with admin -> "user = admin".

    Save... reboot... You know... i do this too often, but to be shure...
    Code:
    flashfs save && flashfs commit && flashfs enable && reboot
    Samba and xinetd are running after the reboot.
    But samba still needs to be configured. This is done with a webinterface:
    Code:
    http://IP.ADRESS.OF.ASUS:901
    Goto "Globals":
    - Change "workgroup" to your workgroup.
    - "netbios name" is the name of your asus (for me again blechbuechse).
    - "hosts allow" should be your subnet e.g. "192.168.1." (leave out the last number)
    - "guest account" is 'admin'.
    Commit changes with "Commit Changes". (You never would have known this )
    Changes in globas need a restart to take effect!

    goto "Shares":
    - Insert "torrent" beside "create share" and press "create share".
    - "comment": "torrent files"
    - "path": "/tmp/harddisk/torrent"
    - "read only" NO
    - "guest ok" YES
    - "browseable" YES
    - Press "commit changes".

    The settings take effect immediately. No reboot necessary.
    You should see your asus in the windows network now.
    Last edited by wengi; 16-12-2008 at 11:01.
    Übersicht aller HowTos --- HowTo Overview (mostly german)
    WL-HDD mit diesem Setup. --- WL-HDD with this setup.
    Kein Support per PM - Frage im jeweiligen Thread! --- No support via pm - ask in the according thread!
    Eine wirklich gute Idee erkennt man daran, dass ihre Verwirklichung von vorne herein ausgeschlossen erscheint. (Albert Einstein)

  2. #2
    Join Date
    Feb 2005
    Location
    Germany - Frankfurt
    Posts
    1,548
    13. NLOAD
    You can see your network load with nload.

    Code:
    ipkg install nload
    This is for a DSL 2000 (2000kbit/sec down- 256kbit/sec upstream):
    Code:
    nload -t 200 -s 7 -i 2048 -o 256 -u H eth1
    14. Adjust profile
    To make life easier at the command promt you will add some alias.
    Code:
    vi /opt/etc/profile
    The file should be executable (chmod ...).
    The content (Edit the nload settings!):
    # Some alias for making life easier

    # To start nload with DSL 6000 settings: 'nld'
    alias nld="nload -t 200 -s 7 -i 6656 -o 640 -u H eth1"

    # Make ls default -la with color coding
    alias ls="ls --color=auto -la"

    # Make pss a grep ps function
    alias pss="ps axf | grep"

    # df human readable (Only works with coreutils installed!)
    # alias df="df -h"
    There is one more line if you installed midnight commander.

    Make it executable:
    Code:
    chmod +x /opt/etc/profile
    Save, reboot:
    Code:
    flashfs save && flashfs commit && flashfs enable && reboot
    You can verify your modification by entering 'alias':
    [admin@blechbuechse root]$ alias
    ls='ls --color=auto -la'
    nld='nload -t 200 -s 7 -i 6656 -o 640 -u H eth1'
    pss='ps axf | grep'
    15. Automate SSH login
    Until now you need to insert user and password for every ssh login. I assume you are as lazy as i am. So we will do this with keys.
    First you need to create a pair of keys. For Windows this is done with PuttyGen.
    Start, press generate and move your mouse until the key is generated.
    The field "Key comment" is used to identify the keys, if there are more than one. Insert your name here.

    Save the private key as file:
    You can save your private key with a passphrase. This is for security reasons. Enter a passphrase.
    Press "Save private Key" and save your private key to a file. (e.g. C:\keys\mykey.ppk)

    Save the public key on the Asus:
    Copy the content of the upper, grey field to the clipboard. The key shold look like this:
    ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAn+NorNZlb9xhogR2DfNq6R qRg04KKXm2t4WIxj/0NWxjOVUAg4fFl2diA+3+f7gjIPdyEJnGUhkfgckYqhfMoZswr TjtvjP00p5O/LPcvGxzpy0XOBty1NQjcYOrOMC6BFrp6Rh0cVThF+sdAYXogn6 w49GOoSvKdgcTLCDubyM= testkey
    YOUR KEY SHOULD LOOK DIFFERENT! THIS IS ONLY AN EXAMPLE.

    You need a special directory to store your public key in. This is in the root/admin home directory:
    Code:
    mkdir /usr/local/root/.ssh
    Edit the file
    Code:
    vi /usr/local/root/.ssh/authorized_keys
    and insert the content of your clipboard. One line per key, no line feeds!
    Multiple keys can be inserted here and are seperated by a new line. One line for each key.

    This part of the filesystem is in the flash so you have to save it:
    Code:
    flashfs save && flashfs commit && flashfs enable && reboot
    Next step is to tell putty to use the key:
    Configure putty:
    "Connection - Data" bei "Auto-login username" enter the username: admin
    "Connection - SSH - Auth" at "Private key file for authentication" Enter the file saved in the above step (e.g. C:\keys\mykey.ppk)
    Do not forget to save (Session - Save)

    Your login should look like this now:
    Using username "admin".
    Authenticating with public key "testkey"
    [admin@blechbuechse root]$
    Optional: Disable login with passwort
    The option "dropbear -s" disables login with password. Only login with keys will be possible!
    Edit /usr/local/sbin/post-boot to modify the option for start.
    Insert a "-s" directly behind dropbear.
    ATTENTION: If you loose your key you are locked out! Use this with care!

    Do not forget to save and reboot.

    16. Open SSH port to Internet (if directly connected)
    You have to open port 22 in your firewall to connect to your router over internet. If your Asus is directly connected to the internet and in home gateway mode you can do this directly. The firewall is iptables.
    Remark: This is a security risk! Be sure to set at least a strong password for your users!!! Have a look at THIS for a secure sshd config.

    Edit your /usr/local/sbin/post-firewall and insert:
    Code:
    #!/bin/sh
    # this opens the ssh port to internet! Be sure to have strong passwords!
    iptables -I INPUT -m tcp -p tcp --dport 22 -j ACCEPT
    And don't forget to save!
    Hint: The iptables command above can also be used to open other ports.
    Last edited by wengi; 04-10-2009 at 12:29.
    Übersicht aller HowTos --- HowTo Overview (mostly german)
    WL-HDD mit diesem Setup. --- WL-HDD with this setup.
    Kein Support per PM - Frage im jeweiligen Thread! --- No support via pm - ask in the according thread!
    Eine wirklich gute Idee erkennt man daran, dass ihre Verwirklichung von vorne herein ausgeschlossen erscheint. (Albert Einstein)

  3. #3
    Join Date
    Feb 2005
    Location
    Germany - Frankfurt
    Posts
    1,548
    17. Optimize performance
    This chapter is for advanced users. You should not do this if you are a newbie.

    Your Asus is completely setup now. Only some optimization regarding the performance is to be done.
    This is to keep as much processor and memory free as possible. Even the WL-HDD only has 16MB RAM and a 125MHz CPU. Not that much...
    The goal is to start services only if they are needed.
    This works with xinetd. Here is a description.

    A) Start samba with xinetd

    This chapter is using the original samba of the firmware. If you installed the IPKG samba you will have to change the path /usr/sbin/ to /opt/...

    I only need samba for moving my torrent files. So this is rather seldom.
    This is why i atart samba with xinetd. To keep system resources free for transmission.
    Your samba must work for 100% before making this step!

    If xinetd is not installed until now:
    Code:
    ipkg install xinetd
    You have to change /opt/etc/init.d/S10xinetd to work with the start|stop feature of rc.unslung.
    Do this as it is described in chapter 12b). Only the part with the content of S10xinetd!

    samba comprises two daemons:
    Code:
    vi /opt/etc/xinetd.d/netbios-ssn
    Content:
    service netbios-ssn
    {
    disable = no
    socket_type = stream
    protocol = tcp
    port = 139
    user = admin
    wait = no
    only_from = localhost 192.168.XXX.1/24
    server = /usr/sbin/smbd
    }
    And the second:
    Code:
    vi /opt/etc/xinetd.d/netbios-ns
    Content:
    service netbios-ns
    {
    disable = no
    socket_type = dgram
    protocol = udp
    port = 137
    user = admin
    wait = yes
    only_from = localhost 192.168.XXX.1/24
    server = /usr/sbin/nmbd
    }
    You have to fit the IP Settings for your own needs!

    There should already be a /etc/smb.conf. If not you will have to create it. This one shares the data partition with read/write for everyone.
    Code:
    [global]
            interfaces = br0
            bind interfaces only = yes
            workgroup = YOURWORKGROUP
            server string = YOURHOSTNAME
            guest account = nobody
            security = share
            browseable = yes
            guest ok = yes
            guest only = yes
            log level = 1
            max log size = 100
            encrypt passwords = no
            preserve case = yes
            short preserve case = yes
            client code page = 850
    
    [disc0_3]
            path = /tmp/mnt/disc0_3
            writable = yes
            force user = admin
    You have to edit Name and workgroup in this file too!

    Now you have to make shure that the /etc/smb.conf is stored before a reboot:
    Code:
    echo "/etc/smb.conf" >> /usr/local/.files && flashfs save && flashfs commit && flashfs enable
    Samba must not run as daemon. You have to disable it in the webinterface and accept the restart now.

    and if you installed samba with IPKG you have to delete the startup file:
    Code:
    rm /opt/etc/init.d/S80samba
    B) Unload unnecessary kernel modules

    Attention: You should know which modules you need, before unloading them in post-boot.

    List all running modules:
    Code:
    lsmod
    It is looking like this:
    [admin@blechbuechse root]$ lsmod
    Module Size Used by
    nfsd 93016 1
    lockd 64236 1 [nfsd]
    sunrpc 83480 1 [nfsd lockd]
    usb-storage 62184 0 (unused)
    sd_mod 13292 0 (unused)
    scsi_mod 70216 1 [usb-storage sd_mod]
    printer 12676 0 (unused)
    usb-ohci 21940 0 (unused)
    usbcore 77264 1 [usb-storage usb-ohci]
    ipt_NETMAP 992 0 (unused)
    ip_nat_starcraft 2224 0 (unused)
    wl 423856 0 (unused)
    et 34912 0 (unused)
    ide-disk 13524 3
    ide-probe-mod 11468 0
    ide-mod 109608 3 [ide-disk ide-probe-mod]
    You have to know which modules are unnecessary. 'Unused' is (sometimes) a good advice.

    This is how you unload a module:
    Code:
    rmmod MODULNAME
    Unloading the module 'et'is not a good idea because network will not work anymore. (Happend to me at this moment )

    Try this modules:

    printer - printer support
    usb-storage - USB mass storage
    usb-ohci - USB host
    usbcore - USB main component
    wl - WLAN

    It would be nice to have a complete list of all modules here. contact me if you can provide information.

    Unload a module and check if all the services are still working.
    If there is something wrong: Do a reboot!
    After knowing the possible modules you can edit the post-boot and paste the unload commands.

    18. Firmwareupdate
    If oleg releases a new firmware you should update:

    1) In webinterface 'System Setup' -> 'Setting Management' click "HERE", to save your settings.
    2) In webinterface 'System Setup' -> 'Flashfs Management' click "HERE", to seve the flash file system.
    3) Download and extract the new firmware. You need the .trx file.
    Important: Wait for the reboot after every following step.
    4) In webinterface 'System Setup' -> 'Firmware Upgrade' select the .trx file and click 'Upload'.
    5) In webinterface 'System Setup' -> 'Setting Management' select your saved settings and click 'Upload'.
    6) In webinterface 'System Setup' -> 'Flashfs Management' select your saved flashfs and click 'Upload'.

    The update is finished and all services should be accessible.
    There will be no data lost.

    General
    I try to keep this HowTo up to date.
    Contact me if you have some improvement or you found a mistake.

    There are several HowTos following this one.
    Soundcards, webserver, mysql and so on.
    FIND IT HERE: http://wl500g.info/showpost.php?p=160532&postcount=1

    Known problems:

    - a 'find' in / results in an error "./proc/7/fd: No such file or directory". Thats normal.

    Thanks to:

    Oleg (for the firmware)
    marcnesium (for his premium How To)
    Oleo (for transmission and good help)
    My wife (for the patience)

    Martin1802 (for finding a mistake in step 4a / 4b and supporting me with the profile)
    hanseugen (for USB HDD und Cron-Tips)
    And all others who helped me improving this howto.

    Important links:
    http://www.nslu2-linux.org/wiki/Optware/Transmission (Step-by-Step Howto for transmission)
    http://wl500g.info/showthread.php?t=6823 (Controlling torrent downloads thru webpage)
    http://wl500g.info/showthread.php?t=5909 (Premium HowTo)
    http://www.macsat.com/macsat/content/category/3/13/29/ (MacSat Tutorials)
    http://wl500g.info/showthread.php?t=8010 (How to connect to dbox2)
    http://www.sprayfly.com/wiki/Sprayfly (Sprayfly WL-HDD Wiki)
    http://wl500g.info/showpost.php?p=25037&postcount=1 (summary of Olegs firmware versions)
    http://wl500g.info/showthread.php?t=6826 (Autocopy funktion for the photographer of you)
    http://wl500g.info/showthread.php?t=13785 (Information on boot files and fstab in firmwares -9 and newer)

    For those of you who want to be up to date with the development:
    http://trac.nslu2-linux.org/optware/timeline Shows all changes.
    Last edited by wengi; 12-07-2010 at 14:10.
    Übersicht aller HowTos --- HowTo Overview (mostly german)
    WL-HDD mit diesem Setup. --- WL-HDD with this setup.
    Kein Support per PM - Frage im jeweiligen Thread! --- No support via pm - ask in the according thread!
    Eine wirklich gute Idee erkennt man daran, dass ihre Verwirklichung von vorne herein ausgeschlossen erscheint. (Albert Einstein)

  4. #4
    Join Date
    Feb 2005
    Location
    Germany - Frankfurt
    Posts
    1,548
    Happy working with your "new" Asus.
    May the force be with you.

    wengi
    Übersicht aller HowTos --- HowTo Overview (mostly german)
    WL-HDD mit diesem Setup. --- WL-HDD with this setup.
    Kein Support per PM - Frage im jeweiligen Thread! --- No support via pm - ask in the according thread!
    Eine wirklich gute Idee erkennt man daran, dass ihre Verwirklichung von vorne herein ausgeschlossen erscheint. (Albert Einstein)

  5. #5

    Thumbs up

    Thanks so much, it spent me more than a week now, I couldn't finish everything without your great tutorial. Great tutorial!

  6. #6
    Join Date
    Feb 2005
    Location
    Germany - Frankfurt
    Posts
    1,548
    Happy to hear it was helpfull for you.

    wengi
    Übersicht aller HowTos --- HowTo Overview (mostly german)
    WL-HDD mit diesem Setup. --- WL-HDD with this setup.
    Kein Support per PM - Frage im jeweiligen Thread! --- No support via pm - ask in the according thread!
    Eine wirklich gute Idee erkennt man daran, dass ihre Verwirklichung von vorne herein ausgeschlossen erscheint. (Albert Einstein)

  7. #7
    Awesome! Good work guys.

    One question, there is possibility to just provide us with a config;file which has already everything integrated?
    Last edited by TinyRK; 31-08-2007 at 19:42.

  8. #8

    Exclamation transmission problem

    after an upgrade/update from 1.22 to 1.33 transmission went bad:

    "Connection Interrupted
    The connection to the server was reset while the page was loading.
    The network link was interrupted while negotiating a connection. Please try again."
    how I fix this thing?

  9. #9
    Join Date
    Feb 2008
    Location
    Copenhagen, Denmark
    Posts
    41

    Just a typo.

    Quote Originally Posted by wengi View Post
    17. Optimize performance

    A) Start samba with xinetd

    If xinetd is not installed until now:
    Code:
    ipkg install xinetd
    You have to change /opt/etc/init.d/S10xinetd to work with the start|stop feature of rc.unslung.
    Do this as it is described in chapter 10b). Only the part with the content of S10xinetd!
    I guess this chapter is 12b now.

  10. #10
    Join Date
    Feb 2005
    Location
    Germany - Frankfurt
    Posts
    1,548
    Hi,

    thanks for the hint.
    Corrected it

    wengi
    Übersicht aller HowTos --- HowTo Overview (mostly german)
    WL-HDD mit diesem Setup. --- WL-HDD with this setup.
    Kein Support per PM - Frage im jeweiligen Thread! --- No support via pm - ask in the according thread!
    Eine wirklich gute Idee erkennt man daran, dass ihre Verwirklichung von vorne herein ausgeschlossen erscheint. (Albert Einstein)

  11. #11
    Join Date
    Feb 2008
    Location
    Copenhagen, Denmark
    Posts
    41

    Location of smb.conf when ipkg samba is installed

    If the IPKG samba is installed the smb.conf is located in /opt/etc/samba
    Last edited by Bohlendach; 03-08-2010 at 12:46.

  12. #12
    Join Date
    Feb 2005
    Location
    Germany - Frankfurt
    Posts
    1,548
    Hi,

    Thats the reason why i state:
    This chapter is using the original samba of the firmware. If you installed the IPKG samba you will have to change the path /usr/sbin/ to /opt/...
    wengi
    Übersicht aller HowTos --- HowTo Overview (mostly german)
    WL-HDD mit diesem Setup. --- WL-HDD with this setup.
    Kein Support per PM - Frage im jeweiligen Thread! --- No support via pm - ask in the according thread!
    Eine wirklich gute Idee erkennt man daran, dass ihre Verwirklichung von vorne herein ausgeschlossen erscheint. (Albert Einstein)

  13. #13
    Join Date
    Feb 2008
    Location
    Copenhagen, Denmark
    Posts
    41

    Smile Did not get it!

    Quote Originally Posted by wengi View Post
    Hi,

    Thats the reason why i state:
    Code:
    This chapter is using the original samba of the firmware. If you installed the IPKG samba you will have to change the path /usr/sbin/ to /opt/...
    wengi
    I must have read it too literally or maybe I am an ignorant. I thought it was only the path /usr/sbin that should be changed to /opt/.

    I did not get that /etc/ also had to be changed to /opt/etc/samba.

    By the way its an exellent guide!
    Last edited by Bohlendach; 03-08-2010 at 18:04.

  14. #14

    Updating firmware

    Quote Originally Posted by wengi View Post
    18. Firmwareupdate
    If oleg releases a new firmware you should update:

    1) In webinterface 'System Setup' -> 'Setting Management' click "HERE", to save your settings.
    2) In webinterface 'System Setup' -> 'Flashfs Management' click "HERE", to seve the flash file system.
    3) Download and extract the new firmware. You need the .trx file.
    Important: Wait for the reboot after every following step.
    4) In webinterface 'System Setup' -> 'Firmware Upgrade' select the .trx file and click 'Upload'.
    5) In webinterface 'System Setup' -> 'Setting Management' select your saved settings and click 'Upload'.
    6) In webinterface 'System Setup' -> 'Flashfs Management' select your saved flashfs and click 'Upload'.


    The update is finished and all services should be accessible.
    There will be no data lost.
    Hi,

    Just updated my firmware from r740 to r2174.

    Are the steps 5 and 6 in the quoted part of the guide up to date? After uploading the new firmware, all my old settings are already there and the old flash filesystem is there too.
    Was my firmware update successful or not? In the webgui I can see that I'm running r2174, but why are the old settings and the old flash filesystem still there???

  15. #15

    Mount a second USB hardisk

    Hi, my router works perfectly. I'm now struggeling with the second USB hardisk. I created a parition on it with fdisk. Then I created ext3 file system on it.
    Code:
    mke2fs -j -m 0 /dev/discs/disc1/part1
    The hardisk is accessible fine at tmp/mnt/disc1_1/. I would like to have the link to the hardisk as /tmp/harddisk2 so I edited /etc/fstab in following way:
    Code:
    #device                 Mountpoint      FStype  Options         Dump    Pass#
    /dev/discs/disc0/part1  none            swap    sw              0       0
    /dev/discs/disc0/part2  /opt            ext3    rw,noatime      1       1
    /dev/discs/disc0/part3  /tmp/harddisk   ext3    rw,noatime      1       1
    /dev/discs/disc1/part1  /tmp/harddisk2   ext3    rw,noatime      1       1
    But the harddisk2 symlink is not created after reboot. If I try "mount -a" the system says that the directory "/tmp/harddisk2" does not exists. How the symlink harddisk2 would be created? What is also strange to me, that when IU delete the "/tmp/harddisk" line from fstab, the symlink for /tmp/harddisk is created anyway.

Page 1 of 2 12 LastLast

Similar Threads

  1. [Howto] Install DLNA media servers for Oleg firmware
    By ecaddict in forum WL-500gP Tutorials
    Replies: 18
    Last Post: 06-06-2017, 07:40
  2. Replies: 24
    Last Post: 05-05-2015, 07:42
  3. Replies: 28
    Last Post: 02-06-2013, 20:58
  4. Replies: 6
    Last Post: 21-09-2012, 17:06
  5. [Howto] Install kernel modules for Oleg firmware
    By ecaddict in forum WL-500gP Tutorials
    Replies: 0
    Last Post: 05-12-2011, 16:18

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •