Page 1 of 10 123 ... 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

    Lightbulb [HowTo] Install and configure Oleg's firmware

    Hier findest Du das originale deutsche HowTo: http://wl500g.info/showthread.php?t=8424

    After some people asked me to, this is a translation of my original, german Howto.
    00. News

    November 2011

    rtn firmware with kernel 2.6 instead of kernel 2.4 uses disca, discb etc.
    you have to replace all occurances of "disc0" with "disca" in this tutorial!!!!
    I will update the tutorial if i have time for it.


    October 2011
    The URL of transmissions level1.gz has changed.
    The script S90transmission-daemon is updated

    Please use, if your hardware is supported, the "enthusiast firmware".
    More details later.

    This howto is for firmware version 1.9.2.7-9 and newer. Older versions are not supported any more.

    Important: I exclude any liability.

    This HowTo is for newbies! please contact me if you find any mistakes.

    0. Premises
    I am working with an Asus WL-HDD. But this HowTo is known to work with other hardware where you can install olegs firmware.
    The WL-HDD has a weak CPU and small memory, but it does the job :-)

    You also need:
    - basic linux knowledge (cd, vi, ps, df, free, top, ...)
    - time. I needed about 5 hours for modifying my WL-HDD incl. dinner. So you need time.
    - an internet connection for downloading the software.

    1. Install firmware

    The easiest way is the Asus Firmware Restoration Tool. Download the tool according to your hardware.

    ASUS WL-HDD2.5 wireless hard disk drive box utility program in English

    It will also work with the Asus Webinterface but be sure to have the restoration tool by hand.
    Download olegs firmware: Firmware Wizzard (not allways newest) or directly at http://oleg.wl500g.info
    Always use the newest version for your hardware model.

    UPDATE:
    There is an advanced version of oleg firmware.
    This one is compatible to the original and is well maintained.
    I recommend using this firmware if your hardware is supported.

    This HowTo wil only work with versions 1.9.2.7-9 and newer!

    Reset your Asus to factory defaults. (user:admin / pw:admin)
    Extract the zip.
    Install the Asus tool, start it and select "firmware restoration".
    Select the firmware (hardware_version.trx) and click upload.
    After the reboot browse to the Webinterface of the router and again reset to factory defaults.
    Again a reboot and your router has a default oleg firmware.

    remark:
    My WL-HDD does NOT act as Router in my network. It is only a client. Because of this i will not handle firewall settings within this howto.

    Do the following in the Webinterface:
    - enter the Name of the router (mine is "blechbuechse").
    - enter you IP settings (IP, gateway, DNS aso.)
    - disable FTP, Samba, NFS
    - enable telnet
    - Change the password
    - do any changes as you need them. (DHCP, time zone, WLAN, aso.)
    - If used as router: login data, firewall, allow ping from WAN.

    If this did NOT work until here you will NOT be able to go on!

    2. Telnet

    Start telnet. For Windows: Start-Execute - "telnet IPOFASUS"

    user:admin / pw:admin

    Test your internet connection:
    Code:
    ping google.de
    Should look like this:
    [admin@blechbuechse root]$ ping google.de
    PING google.de (66.249.93.104): 56 data bytes
    64 bytes from 66.249.93.104: icmp_seq=0 ttl=243 time=35.5 ms
    64 bytes from 66.249.93.104: icmp_seq=1 ttl=243 time=36.5 ms
    64 bytes from 66.249.93.104: icmp_seq=2 ttl=243 time=35.0 ms

    --- google.de ping statistics ---
    3 packets transmitted, 3 packets received, 0% packet loss
    round-trip min/avg/max = 35.0/35.6/36.5 ms
    [admin@blechbuechse root]$
    The ping can be interrupted with ctrl-c.

    If this is NOT working: Do not ping a name, ping an IP adress.
    If you are not able to ping an ip adress: check your network (IP, DNS) settings and cabeling.

    telnet is not a secure way to work on your asus. Espacially over internet. This is why you install SSH now:

    3. SSH-deamon
    TIP: You can copy & paste all commands within telnet and putty. For Windows use ctrl-c and ctrl-v, for putty mark the text and right click.

    The name of the ssh daemon is dropbear. It can be activated with the Web Interface (System Setup->Services) if you use the "enthusiast firmware" (1.9.2.7-d-rxxxx). Using the new firmware you only have to generate the keys and startup scripts.
    Users of firmwares before 1.9.2.7-d-rxxxx need to execute the whole chapter!

    create startup scripts:
    Code:
    mkdir -p /usr/local/sbin/
    touch /usr/local/sbin/pre-boot
    touch /usr/local/sbin/post-boot
    touch /usr/local/sbin/post-firewall 
    touch /usr/local/sbin/post-mount
    touch /usr/local/sbin/pre-mount
    touch /usr/local/sbin/pre-shutdown
    chmod +x /usr/local/sbin/*
    create a directory: (only firmware older than 1.9.2.7-d-rxxxx)
    Code:
    mkdir -p /usr/local/etc/dropbear
    generate keys:
    Code:
    dropbearkey -t dss -f /usr/local/etc/dropbear/dropbear_dss_host_key
    dropbearkey -t rsa -f /usr/local/etc/dropbear/dropbear_rsa_host_key
    To make dropbear start at reboot: (only firmware older than 1.9.2.7-d-rxxxx)
    Code:
    echo "#!/bin/sh" >> /usr/local/sbin/post-boot
    echo "dropbear" >> /usr/local/sbin/post-boot
    Start dropbear:
    Code:
    dropbear
    Here is a listing of the active processes. dropbear should be one of them:
    [admin@blechbuechse sbin]$ ps
    PID Uid VmSize Stat Command
    1 admin 580 S /sbin/init
    2 admin SW [keventd]
    3 admin SWN [ksoftirqd_CPU0]
    4 admin SW [kswapd]
    5 admin SW [bdflush]
    6 admin SW [kupdated]
    7 admin SW [mtdblockd]
    46 admin 332 S telnetd
    51 admin 380 S httpd
    54 admin 408 S syslogd -m 0 -O /tmp/syslog.log -S -l 7
    56 admin 364 S klogd
    57 admin SW [khubd]
    72 1 364 S [portmap]
    74 admin 504 S /usr/sbin/statd
    76 admin SW [nfsd]
    77 admin SW [lockd]
    78 admin SW [rpciod]
    80 admin 484 S /usr/sbin/mountd
    83 admin 484 S watchdog
    85 admin 344 S ntp
    94 admin SW [kjournald]
    95 admin SW [kjournald]
    99 admin 580 S -sh
    128 admin 468 S dropbear
    129 admin 392 R ps
    save all the stuff and reboot:
    Code:
    flashfs save && flashfs commit && flashfs enable && reboot
    That's it for this part.
    Last edited by wengi; 10-11-2011 at 08:02.
    Ü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
    4. partition and format HDD
    Important for USB Disks: Power on First HDD , second router.

    IMPORTANT: You will loose all the data on your HDD. Make a backup if necessary.

    From now on you will work with putty.

    Start putty, enter the IP adress of your box and select SSH.
    Confirm the Key.

    My HDD (80GB) is partitioned as follows:
    data (part1), IPKG (part2) und swap (part3)
    all primary, no extended
    Swap 512MB (You can also use 128MB if you want to save some space)
    IPKG 1GB
    Data the rest (~78GB)

    View mountpoints

    [admin@blechbuechse root]$ df
    Filesystem 1k-blocks Used Available Use% Mounted on
    /dev/root 3008 3008 0 100% /
    /dev/discs/disc0/part1 75398848 683812 70884940 1% /tmp/mnt/disc0_1
    [admin@blechbuechse root]$
    If there is nothing except / go directly to fdisk.

    If you allready partitioned your HDD as you want (incl. swap) go to the next chapter. BUT: i recommend using fdisk because several users reported problems in mounting partitions created with third party software.

    You should unmount all mounts except /.
    Code:
    umount /place/of/mountpoint
    /place/of/mountpoint needs to be replaced with the entries from df. E.g. "umount /tmp/mnt/disc0_1".
    If there is an error message during umount there is activity on the mount. Did you disable FTP / Samba, ...?

    After unmounting all it should look like this:
    [admin@blechbuechse root]$ df
    Filesystem 1k-blocks Used Available Use% Mounted on
    /dev/root 3008 3008 0 100% /
    There may be a tmpfs mounted on /tmp which depends on the used firmware and does NOT need to be unmounted.
    Partition with fdisk:
    Code:
    fdisk /dev/discs/disc0/disc
    fdisk:
    m for help.
    p for view partitions.
    d for delete.
    n for new.

    Delete all existing partitions, if any. All data will be lost!!! create new partitons after deleting the old ones:

    partitions:
    part1 Swap 512MB type82
    part2 IPKG 1024MB /opt
    part3 data rest /tmp/harddisk (This is a point where WL-HDD differs to others..!?!)

    Create swap: n -> p -> 1 -> 'return' -> +512M -> t -> 82
    Create IPKG: n -> p -> 2 -> 'return' -> +1024M
    Create data: n -> p -> 3 -> 'return' -> 'return'

    Save settings by pressing w and exit.
    "fdisk -l" will show your partitions:
    [admin@blechbuechse root]$ fdisk -l

    Disk /dev/ide/host0/bus0/target0/lun0/disc: 80.0 GB, 80026361856 bytes
    16 heads, 63 sectors/track, 155061 cylinders
    Units = cylinders of 1008 * 512 = 516096 bytes

    Device Boot Start End Blocks Id System
    /dev/ide/host0/bus0/target0/lun0/part1 1 993 500440+ 82 Linux swap
    /dev/ide/host0/bus0/target0/lun0/part2 994 2978 1000440 83 Linux
    /dev/ide/host0/bus0/target0/lun0/part3 2979 155061 76649832 83 Linux
    Now you activate the swap:
    This is a 'free' without swap:
    [admin@blechbuechse root]$ free
    total used free shared buffers
    Mem: 13932 11304 2628 0 1388
    Swap: 0 0 0
    Total: 13932 11304 2628
    [admin@blechbuechse root]$
    activate swap:
    Code:
    mkswap /dev/discs/disc0/part1
    swapon /dev/discs/disc0/part1
    'free' should look like this after activating:
    [admin@blechbuechse root]$ free
    total used free shared buffers
    Mem: 13932 10236 3696 0 1320
    Swap: 500432 0 500432
    Total: 514364 10236 504128
    [admin@blechbuechse root]$
    Now you have enough free memory to format the rest of the HDD:
    Code:
    mke2fs -j /dev/discs/disc0/part2 
    mke2fs -j -m 0 /dev/discs/disc0/part3
    part3 will take some time, depending on HDD size. The option '-m 0' will set reserved blocks to 0. Do NOT try this on /opt partition!!!
    A remark for the newbies: The partitions are ext3 formated. This is what you want!. You do NOT need Fat or NTFS to access your data.

    You need to edit the file fstab to automaticaly mount the partitions
    a short vi Explanation: vi is an editor.
    You enter the insert mode with i, you leave it with ESC.
    You can insert the content of the clipboard by right clicking within insert mode.
    After leaving the insert mode you quit and save by typing ':wq'. Leaving without saving is ':q!'.
    This is all. Search for a vi howto for more.

    Edit the file /etc/fstab by typing:
    Code:
    vi /etc/fstab
    and paste this:
    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
    Partitions are mounted and swap is activated.
    Important: The data partition is mounted to /tmp/hardisk as in fstab. This is handled different in the firmware because of compatibility issues: The Partition is mounted to /tmp/mnt/disc0_3 and a symlink is pointing from /tmp/hardisk to /tmp/mnt/disc0_3
    To save fstab for reboot:
    Code:
    echo "/etc/fstab" >> /usr/local/.files
    5. Startup-scripts
    The time zone in the firmware is not correct for middle europe. We will correct this:
    This issue is fixed from verison wl500g-1.9.2.7-d-r240 (2009-04-11) on.
    If you use any newer version you can continue with i /usr/local/sbin/pre-mount.
    Code:
    vi /usr/local/sbin/pre-boot
    content:
    Code:
    #! /bin/sh
    tz="CET-1CEST-2,M3.5.0/02:00:00,M10.5.0/03:00:00"
    nvram set time_zone="$tz"
    echo "$tz" > /etc/TZ
    Have a look at http://wl500g.info/showpost.php?p=139268&postcount=4 or http://wl500g.info/showthread.php?t=13727 for details.

    There is a script to keep the file system clean:
    Code:
    vi /usr/local/sbin/pre-mount
    with this content:
    Code:
    #! /bin/sh
    
    swapon -a
    
    for i in `awk '/ext3/{print($1)}' /etc/fstab` ; do
      if [ -b $i ] ; then
        grep -q $i /proc/mounts || e2fsck -p $i 2>&1 | logger -t e2fsck
      else
        logger -t fstab "$i is not attached"
      fi
    done
    pre-mount will start e2fsck if needed. My WL-HDD with its 80GB HDD takes some hours to do this check! It is possible that your router is switched on and the HDD becomes available hours later. You can leave pre-mount empty to prevent this, but your file system will have to be checked from time to time. Your decision. I have this activated.
    post-mount is executed after pre-mount
    Code:
    vi /usr/local/sbin/post-mount
    content:
    Code:
    #! /bin/sh
    
    /opt/etc/init.d/rc.unslung start
    And this file is executed before shutting down:
    Code:
    vi /usr/local/sbin/pre-shutdown
    And again content:
    Code:
    #! /bin/sh
    
    /opt/etc/init.d/rc.unslung stop
    
    sleep 10s
    
    for i in `cat /proc/mounts | awk '/ext3/{print($1)}'` ; do
      mount -oremount,ro $i
    done
    
    swapoff -a
    
    sleep 1s
    This script is remounting all partitions as read only to prevent loss of data at power off.

    The HDD has to be mounted before editing the next file. But the best is to save and reboot:
    Code:
    flashfs save && flashfs commit && flashfs enable && reboot
    check swap and mount of HDD with 'free' and 'df -h'. Everything ok? Next step.

    Software and services installed via IPKG write scripts to /opt/etc/init.d.
    You need a mechanism to start these scripts. This mechanism (a script) is triggert by post-boot.
    Code:
    mkdir /opt/etc
    mkdir /opt/etc/init.d
    vi /opt/etc/init.d/rc.unslung
    Remark: If you get a "mkdir: Cannot create directory `/opt/etc': Read-only file system" your HDD (here the IPKG pertition) is NOT mounted.

    Content:
    #! /bin/sh

    # Start/stop all init scripts in /opt/etc/init.d
    # starting them in numerical order and
    # stopping them in reverse numerical order
    #
    if [ $# -ne 1 ]; then
    printf "Usage: $0 {start|stop}\n" >&2
    exit 1
    fi

    daemons=`echo $(/usr/bin/dirname $0)/S??*`
    [ $1 = "stop" ] && daemons=`echo $daemons | /usr/bin/tr " " "\n" | /usr/bin/sort -r`

    for i in $daemons; do

    # Ignore dangling symlinks (if any).
    [ ! -f "$i" ] && continue

    # Write to syslog
    logger -t rc.unslung "$1 service $i"

    case "$i" in
    *.sh)
    # Source shell script for speed.
    (
    trap - INT QUIT TSTP
    set $1
    . $i
    )
    ;;
    *)
    # No sh extension, so fork subprocess.
    $i $1
    ;;
    esac
    done
    Make it executable:
    Code:
    chmod +x /opt/etc/init.d/rc.unslung
    And this part is done
    Last edited by wengi; 01-06-2010 at 16:06.
    Ü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
    6. IPKG

    IPKG is a package management system. You can install additional software with it.
    IPKG works on your HDD in /opt. Thats why you created and mounted the IPKG partition in /usr/local/sbin/post-boot.
    By the way: The log files are written to /opt/var/log.

    The steps to install the package management system are:
    create a directory.
    Code:
    mkdir -p /opt/tmp/ipkg 
    cd /opt/tmp/ipkg
    Download and install the packages (ignore all errors):
    Code:
    wget http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/ipkg-opt_0.99.163-10_mipsel.ipk
    ipkg.sh install ipkg-opt_0.99.163-10_mipsel.ipk
    wget http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/uclibc-opt_0.9.28-13_mipsel.ipk
    ipkg.sh install uclibc-opt_0.9.28-13_mipsel.ipk
    ipkg update
    Use the following command to see which packages are installed:
    Code:
    ipkg list_installed
    It looks like this:
    [admin@blechbuechse ipkg]$ ipkg list_installed
    ipkg-opt - 0.99.163-10 - The Itsy Package Manager
    uclibc-opt - 0.9.28-13 - micro C library for embedded Linux systems
    Successfully terminated.
    You can keep your installation up to date in future.
    Execute regularly:
    Code:
    ipkg update
    ipkg upgrade
    7. Midnight Commander (optional)

    Install MC
    Code:
    ipkg install mc
    Some settings are necessary for MC to run properly.
    Code:
    echo "export TERMINFO=/opt/share/terminfo">>/opt/etc/profile
    echo "alias mc=\"mc -c\"">>/opt/etc/profile
    make profile executable:
    Code:
    chmod +x /opt/etc/profile
    8. Tools (optional)

    These tools are very helpful. I recommend installing them even if they are not necessary. 1GB on the HDD is enough space, so:
    Code:
    ipkg install coreutils
    ipkg install findutils
    ipkg install diffutils
    ipkg install screen
    ipkg install nano
    ipkg install procps
    ipkg install less
    ipkg install unzip
    ipkg install hdparm
    ipkg install man
    ipkg install man-pages
    ipkg install lynx
    ipkg install e2fslibs
    ipkg install e2fsprogs
    9. CRON

    Cron is a task scheduler.
    Code:
    ipkg install cron
    Edit the cron startup script:
    Code:
    vi /opt/etc/init.d/S10cron
    And replace the content with:
    Code:
    #!/bin/sh
    #
    # Startup script for cron
    
    PIDFILE=/opt/var/run/cron.pid
    
    case $1 in
     start)
       /opt/sbin/cron
       ;;
     stop)
       [ -f ${PIDFILE} ] && kill `cat ${PIDFILE}`  ;;
       *)
       echo "usage: $0 (start|stop)"
       exit 1
    esac
    Save and reboot:
    Code:
    flashfs save && flashfs commit && flashfs enable && reboot
    Cron must be in the process list (ps) after a reboot.
    Remark: If you installed procps you should execute:
    Code:
    ps axf
    If cron is NOT listed as running process: Check the content of rc.unslung and post-boot.

    If you want a task to be executed you have to make an entry to the crontab (/opt/etc/crontab)
    Finished with cron
    Last edited by wengi; 18-07-2010 at 23:35.
    Ü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
    10. TRANSMISSION (The torrent Client)
    You have some routine 'til here. So we start directly:
    Code:
    ipkg install transmission
    ipkg install wget
    Create working directories:
    Code:
    mkdir -p /tmp/harddisk/transmission/download
    mkdir -p /tmp/harddisk/transmission/config/blocklists
    chmod -R 770 /tmp/harddisk/transmission/
    Config file:
    Code:
    vi /tmp/harddisk/transmission/config/settings.json
    With this content:
    Code:
    {
        "blocklist-enabled": true,
        "dht-enabled": true,
        "download-dir": "/tmp/harddisk/transmission/download", 
        "encryption": 2, 
        "lazy-bitfield-enabled": true, 
        "open-file-limit": 64, 
        "peer-limit-global": 250, 
        "peer-limit-per-torrent": 60, 
        "peer-port": 51413, 
        "peer-port-random-enabled": false, 
        "peer-port-random-high": 65535, 
        "peer-port-random-low": 1024, 
        "peer-socket-tos": 8, 
        "pex-enabled": true, 
        "port-forwarding-enabled": false, 
        "preallocation": 1, 
        "proxy": "", 
        "proxy-auth-enabled": false, 
        "proxy-auth-password": "", 
        "proxy-auth-username": "", 
        "proxy-enabled": false, 
        "proxy-port": 80, 
        "proxy-type": 0, 
        "rpc-authentication-required": false, 
        "rpc-enabled": true, 
        "rpc-password": "", 
        "rpc-port": 9091, 
        "rpc-username": "", 
        "rpc-whitelist": "127.0.0.1,192.168.1.*", 
        "rpc-whitelist-enabled": true,
        "speed-limit-down": 500,
        "speed-limit-down-enabled": false,
        "speed-limit-up": 20,
        "speed-limit-up-enabled": true  
    }
    More config. These are changeing sometimes...

    Create startup script:
    Code:
    vi /opt/etc/init.d/S90transmission-daemon
    Content:
    Code:
    #!/bin/sh
    #
    # Startup script for transmission
    
    case $1 in
     start)
            # update blocklist
            echo "updating blocklist"
            cd /tmp/harddisk/transmission/config/blocklists
            if wget -q -N --tries=3 --timeout=10 http://www.bluetack.co.uk/config/level1.gz
              then
              if test -f level1.gz; then
                 rm level1
                 gunzip level1.gz
                 chmod go+r level1
              fi
            else
              echo "Error $?. Blocklist NOT updated."
            fi
    
            # start transmission
            echo "starting transmission"
            nice /opt/bin/transmission-daemon -g /tmp/harddisk/transmission/config
       ;;
    
     stop)
            if [ -n "`pidof transmission-daemon`" ]; then
                    echo "stopping transmission"
                    kill -9 `pidof transmission-daemon`
            fi
       ;;
     restart|force-reload)
            $0 stop
            sleep 1
            $0 start
       ;;
    
     *)
            echo "usage: $0 (start|stop|restart|force-reload)"
            exit 1
    esac
    Make it executable and start it
    Code:
    chmod 755 /opt/etc/init.d/S90transmission-daemon
    /opt/etc/init.d/S90transmission-daemon start
    Check the transmission process with
    Code:
    ps axf
    and browse (IE not supported) to transmission is working
    It is a good idea to use ONE widely distributed torrent for testing transmission.
    Download the torrent file, click OPEN in the webinterface and select your torrent file.
    You will find the download in /tmp/harddisk/transmission/download.

    Transmission uses port 51413.
    More information on transmission: http://www.nslu2-linux.org/wiki/Optware/Transmission

    11. Logrotate for Syslog
    Install logrotate
    Code:
    ipkg install logrotate
    Create folder for syslog (not /tmp any more)
    Code:
    mkdir -p /opt/var/log/
    Edit crontab
    Code:
    vi /opt/etc/crontab
    and add the following line
    0 0 * * * admin /opt/sbin/logrotate -f /opt/etc/logrotate.conf &>/dev/null
    Edit logrotate:
    Code:
    vi /opt/etc/logrotate.conf
    Substitute the complete content with this:
    compress

    /opt/var/log/syslog.log {
    size 1024k
    weekly
    rotate 9
    postrotate
    killall -HUP syslogd
    endscript
    }

    include /opt/etc/logrotate.d
    Syslog needs to be started:
    Code:
    vi /opt/etc/init.d/S05syslogd
    Content:
    Code:
    #!/bin/sh
    #
    # Startup script for syslog
    #
    PATH=/opt/bin:/opt/sbin:/opt/local/bin:/sbin:/bin:/usr/bin:/usr/sbin
    
    LOGFILE=syslog.log
    KERNLOGFILE=kern.log
    LOG_OLD=/tmp
    LOG_NEW=/opt/var/log
    
    prefix=""
    sbindir=${prefix}/sbin
    
    NAME=syslogd
    DAEMON=${sbindir}/${NAME}
    DESC="syslogd"
    OPTIONS="-m 0 -O $LOG_NEW/$LOGFILE -S -l 7 -s 0"
    
    case "$1" in
    start0)
    printf "Starting ${DESC}: "
    # Copy old syslog and create symlink to new
    if [ ! -L /tmp/syslog.log ]; then
    cat $LOG_OLD/$LOGFILE >> $LOG_NEW/$LOGFILE
    mv $LOG_OLD/$LOGFILE $LOG_NEW/$KERNLOGFILE
    ln -s $LOG_NEW/$LOGFILE $LOG_OLD/$LOGFILE
    fi
    ${DAEMON} ${OPTIONS}
    printf "${NAME}.\n"
    logger -t ${NAME} "started."
    ;;
    stop)
    if [ -n "`pidof syslogd`" ]; then
    printf "Stopping ${DESC}: "
    killall "${NAME}"
    printf "${NAME}.\n"
    fi
    ;;
    start|restart|force-reload)
    $0 stop
    sleep 1
    $0 start0
    ;;
    *)
    printf "Usage: $0 {start|stop|restart|force-reload}\n" >&2
    exit
    ;;
    esac
    
    exit 0
    And must be executable:
    Code:
    chmod +x /opt/etc/init.d/S05syslogd
    To be sure, you know what will come, save and reboot:
    Code:
    flashfs save && flashfs commit && flashfs enable && reboot
    Last edited by wengi; 30-09-2011 at 15:35.
    Ü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
    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)

  6. #6
    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)

  7. #7
    Quote Originally Posted by wengi View Post
    10. SAMBA2
    The original version in olegs firmware has a problem with Windows Vista.
    Because of this, you install the package 'samba2'. This should work with Vista (Due to a missing Vista i can not test it).
    Samba has to be disabled in the Asus webinterface! (USb Application -> Samba -> Enable Samba Demo mode: NO)

    Code:
    ipkg install xinetd
    ipkg install samba2
    Edit the conf of xinetd:
    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
    I followed all the steps you outlined, but samba isn't starting on it's own after reboot. I can start it manually by running /opt/etc/init.d/S80samba and everything works fine then.

    Am I missing something?

  8. #8
    Quote Originally Posted by wengi View Post
    9. TRANSMISSION (The torrent Client)
    Transmission works really strange

    when i open http://192.168.1.1:8080/cgi-bin/transmission.cgi i get
    Code:
    syslog: /opt/var/log/messages unavailable for transfer stats!
    although I did everything just like in howto

    when i click watchdog i get
    Code:
    /opt/sbin/transmission_watchdog: kill: 306: (524) - Operation not permitted grep: /tmp/harddisk/torrent/work/my.torrent/.status: No such file or directory
    when i select torrent in list and click push i get
    Code:
    transmission.cgi: kill: 9: (524) - Operation not permitted
    Any ideas?

    Update 1

    Right after restart transmission_watchdog doesn't appear.
    If it's started manually i get a lot of instatnces
    Code:
      183 admin       468 S   upnp -D -L br0 -W vlan1
      214 admin      1696 S   transmissiond -p 65534 -w 300 -u -1 -d -1 -i /opt/var/run/transmission.pid /tmp/harddisk/torrent/active-torrents.txt
      217 admin      1700 S   transmissiond -p 65534 -w 300 -u -1 -d -1 -i /opt/var/run/transmission.pid /tmp/harddisk/torrent/active-torrents.txt
      218 admin      1700 S   transmissiond -p 65534 -w 300 -u -1 -d -1 -i /opt/var/run/transmission.pid /tmp/harddisk/torrent/active-torrents.txt
      219 admin      1700 S   transmissiond -p 65534 -w 300 -u -1 -d -1 -i /opt/var/run/transmission.pid /tmp/harddisk/torrent/active-torrents.txt
      220 admin      1700 R   transmissiond -p 65534 -w 300 -u -1 -d -1 -i /opt/var/run/transmission.pid /tmp/harddisk/torrent/active-torrents.txt
      222 admin       412 R   ps
    Does it matter?
    Last edited by Aramaki; 23-10-2007 at 12:48.
    Hardware: WL-500gp 1.9.2.7-7g + powered USB hub (WD Passport 120GB) + USB HP LazerJet 1010
    Software: transmission (BT-client) by wengie's manual + russian names fixing script | http/ftp download with web-interface ADOS by DINI (uninstalled) | rsnapshot - incremental backup utility using rsync (english, ðóññêèé) (uninstalled) | lighttpd (uninstalled) |samba2

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

    transmission is not started directly after restart. It normaly depends on the cron entry. E.g. if the watchdog is started hourly, transmission will be started the next full hour after thr reboot.

    If you want to start it directly after the reboot: Add transmission_watchdog to your post-boot.

    There are always multiple instances of transmission running.
    This is normal.

    For the errors: try another torrent. Maybe the file was damaged. How do you copy the torrents? wget in ssh / ftp / samba? I normaly use wget in ssh session.

    wengi

    PS: please edit your post and delete the torrent name or use a legal torrent.
    Ü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)

  10. #10
    Join Date
    Feb 2008
    Location
    Copenhagen, Denmark
    Posts
    41
    Hi Wengi.

    Thx a lot for this awesome guide.

    You wrote:
    11. Logrotate for Syslog
    Add the following to crontab:

    Code:
    0 0 * * * admin /opt/sbin/logrotate -f /opt/etc/logrotate.conf &>/dev/null
    However, crontab is not mentioned elsewhere. It would be better if you write:

    Edit crontab:
    Code:
    vi /opt/etc/crontab
    and add the following:

    Code:
    0 0 * * * admin /opt/sbin/logrotate -f /opt/etc/logrotate.conf &>/dev/null

  11. #11
    Join Date
    Feb 2005
    Location
    Germany - Frankfurt
    Posts
    1,548
    Thank you.

    i changed the syslog chapter and added a hint to crontab in the cron chapter.

    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)

  12. #12
    hi,

    I've had a new problem. Recently when i use transmission, the speed became very slow (about 10kb/s), but when i use my pc (with Deluge), i have 100kb/s. What's wrong? i use this torrent http://thepiratebay.org/torrent/4654...TV_XviD-SC-SDH
    BTW, how do i use Clutch?

    thanks a lot

  13. #13
    Thank you wengi for an awesome how-to.

  14. #14

    Question Can get transmission to work --> Permission denied

    Dear Wengi,
    Many thanks for your great HowTo! I've managed to format the HDD.

    Unfortunately, I can get Transmission working on my setup (WL-500W with Oleg 1.9.2.7-10 and an USB memory card or USB-HDD).

    I get the following error when starting S90transmission-daemon:
    Code:
    /opt/etc/init.d/S90transmission-daemon: /opt/etc/init.d/S90transmission-daemon: 36: /tmp/harddisk/transmission/config: Permission denied
    transmission-daemon is not started according to ps axf.

    When starting transmission with "$transmission-daemon", or
    Code:
    $transmission-daemon -g /tmp/harddisk/transmission/config
    the program starts, but I get the following error when I try to enter 192.168.1.1:9091
    Code:
    401: Unauthorized
    Unauthorized IP Address.
    Either disable the IP address whitelist or add your address to it.
    If you're editing settings.json, see the 'rpc-whitelist' and 'rpc-whitelist-enabled' entries.
    If you're still using ACLs, use a whitelist instead. See the transmission-daemon manpage for details.
    I've tried changing the rpc-whitelist, in the settings.json, but without success.

    I have followed your HowTo, but cannot figure out what Permission is denied?!?

    edit: "chmod a +rwx" the settings file and download directory also did not help
    Last edited by quazar; 06-01-2009 at 08:38.

  15. #15
    Check your instalation again, you probably missed something.

    Is there a limit to the number of torrents that Transmission can hadle?

Page 1 of 10 123 ... 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
  •