Page 1 of 64 1231151 ... LastLast
Results 1 to 15 of 958

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

  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
    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)

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

  9. #9

    Thumbs up

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

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

  11. #11
    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.

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

    1) I am not the guy to build firmware. So i am not your man.
    2) There will never be a firmware with "everything integrated" because you never know who need which comonents and some components will never work together.
    3) (And the important one) If anybody over here will provide a "all-in-one firmware" you would install it and have no idea how to use it. So the questions would start again. And there would be howtos for using the things. In my eyes its better you learn by modifying your own firmware.

    Learning by doing!

    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 2005
    Location
    Germany - Frankfurt
    Posts
    1,548
    From PM:
    Quote Originally Posted by carry
    hi,wengi
    got a problem

    putty connect to WL-HDD
    network error:connection refused.

    how to

    thanks.
    Quote Originally Posted by wengi
    More input! From LAN or internet?
    Firewall? What are you doing EXACTLY?

    wengi
    Quote Originally Posted by carry
    From LAN ,no Firewall

    AT 4b. Startup-scripts

    APPEND the following line:
    Quote:
    echo "nameserver IP.OF.DNS.SERVER" > /etc/resolv.conf

    when save and reboot then putty connection refused
    You only need this line if your Asus is NOT configured as Router to connect to the internet. If you are NOT using it as router try to use DHCP (If you have a DHCP Server in your LAN) for the first step.

    You can ping your Asus and connect to the Webinterface?

    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)

  14. #14
    Yes, I can ping,telnet and connect to the Asus Webinterface.
    also can set IP Address and Gateway...
    my Asus is as a client in the network.

    the point is when i add this line:
    echo "nameserver IP.OF.DNS.SERVER" > /etc/resolv.conf
    save and reboot

    then use putty program SSH connect to Asus

    PuTTY Fatal Error
    network error:connection refused

  15. #15
    Join Date
    Feb 2005
    Location
    Germany - Frankfurt
    Posts
    1,548
    Just to be sure: You replaced the "IP.OF.DNS.SERVER" with the IP adress of your DNS server?
    This line for _my_ network looks like this:
    Code:
    echo "nameserver 192.168.201.1" > /etc/resolv.conf
    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)

Page 1 of 64 1231151 ... 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
  •