[WAG320N] Build firmware with a modified FS

DeerHunter
2012-02-07
2012-12-10
1 2 > >> (Page 1 of 2)
  • DeerHunter
    DeerHunter
    2012-02-07

    Source code: http://www.mediafire.com/?qpyp3mhou91nl4m
    Edit kernel/src/scripts/mod/sumversion.c and add #include <limits.h> on the
    first line
    File System (replace target.tgz in source code) http://www.mediafire.com/?um1
    n9eo3tp33c26
    ...
    Modify the new target.tgz as you wish...
    make clean_all
    make clean
    make auto .
    ¡Voilà!

     
    • Frank
      Frank
      2012-12-10

      Maybe you forgot what to include in /src/scripts/mod/sumversion.c,
      it was include linux/limits.h
      in the makefile of hostTools I had to add -lm option to LDOPTIONS

       
      Last edit: Frank 2012-12-13
  • Gnommo Modfs
    Gnommo Modfs
    2012-02-07

    Hi,
    let me understand.
    Are you able now to build full working bin image through this procedure?
    Have you tested it?

    The next step to automatically start modfs is to add to firmware:
    loop.ko, ext3.ko, mbcache.ko, jbd.ko kernel module (I can compile for you)
    then add losetup to /bin (you can use that is in modfs wag320 bin dir)

    The generic script to found mod_image.bin on a usb device and boot modfs
    is:

    shares="root path where usb device are mounted"
    loopdev="/dev/loop0"

    ls $shares | while read line; do
    image=ls $shares/$line/mod_image.bin 2>&1
    if ; then
    insmod $shares/$line/jbd.ko
    insmod $shares/$line/mbcache.ko
    insmod $shares/$line/ext3.ko
    mknod $loopdev b 7 0
    $shares/$line/losetup $loopdev $image

    mountpath="/tmp/modfs"

    mkdir -p $mountpath
    mount -t ext3 $loopdev $mountpath
    $mountpath/boot.sh $mountpath

    These steps have to be tested one by one in order to find the correct form for
    wag320n and create the right script to add to rcS.

    This for example is to dgn2200 script added at the end of rcS for start modfs

    !/bin/sh

    basepath="/tmp/mod"
    devmountpath="$basepath/dev"
    modmountpath="$basepath/modfs"
    modules="/lib/modules/mod"
    loopdev="/dev/loop0"

    sleep 45

    oldfat32=""
    counter=1
    mkdir -p $devmountpath

    while ; do

    fat32=fdisk -l | grep "FAT32" | cut -d' ' -f1

    if ; then

    FAT32 partitions

    for dev in $fat32; do
    mount -t vfat $dev $devmountpath
    sleep 2
    image="$devmountpath/mod_image.bin"

    if ; then
    echo "Found on $dev"
    insmod $modules/mbcache.ko
    insmod $modules/jbd.ko
    insmod $modules/ext3.ko
    insmod $modules/loop.ko
    losetup $loopdev $image
    mkdir -p $modmountpath
    mount -t ext3 $loopdev $modmountpath
    sleep 1
    exec $modmountpath/boot.sh $modmountpath
    fi
    echo "Not found on $dev"
    umount $dev
    sleep 2
    done
    fi

    oldfat32=$fat32
    counter=expr $counter + 1
    sleep 1
    done

     
  • DeerHunter
    DeerHunter
    2012-02-07

    The build is tested on my router.. I was able to put a 'patata' file inside
    /usr/bin directory ..
    I am starting on Friday night.. so ,yes.. I will do what you said..
    ah.. the list of built-in modules is: (I'll need you to compile the ones you
    said..)

    /lib/modules/2.6.21.5/extra/bcm_enet.ko
    /lib/modules/2.6.21.5/extra/ipt_DLOG.ko
    /lib/modules/2.6.21.5/extra/ipt_LOG.ko
    /lib/modules/2.6.21.5/extra/ipt_http_string.ko
    /lib/modules/2.6.21.5/extra/ipt_layer7.ko
    /lib/modules/2.6.21.5/extra/ipt_multi_match.ko
    /lib/modules/2.6.21.5/extra/ipt_psd.ko
    /lib/modules/2.6.21.5/extra/ipt_random.ko
    /lib/modules/2.6.21.5/extra/ipt_string.ko
    /lib/modules/2.6.21.5/extra/ipt_stringGET.ko
    /lib/modules/2.6.21.5/extra/ipt_stringHEAD.ko
    /lib/modules/2.6.21.5/extra/ipt_stringHOST.ko
    /lib/modules/2.6.21.5/extra/ipt_unkowntype.ko
    /lib/modules/2.6.21.5/extra/ipt_webstr.ko
    /lib/modules/2.6.21.5/extra/nf_conntrack_ipsec.ko
    /lib/modules/2.6.21.5/extra/nf_conntrack_proto_esp.ko
    /lib/modules/2.6.21.5/extra/nf_conntrack_sip.ko
    /lib/modules/2.6.21.5/extra/nf_nat_ipsec.ko
    /lib/modules/2.6.21.5/extra/nf_nat_proto_esp.ko
    /lib/modules/2.6.21.5/extra/nf_nat_pt.ko
    /lib/modules/2.6.21.5/extra/nf_nat_sip.ko
    /lib/modules/2.6.21.5/extra/wl.ko
    /lib/modules/2.6.21.5/extra/xt_layer7.ko
    /lib/modules/2.6.21.5/extra/xt_string.ko
    
    /lib/modules/2.6.21.5/kernel/net:
    ipv4
    
     
  • DeerHunter
    DeerHunter
    2012-02-07

    sorry.. these ones too

    dsl_phy.bin
    fast_br.ko
    ipt_httpMETHOD.ko
    ipt_httpReturnCode.ko
    push_button.ko
    ufsd.ko
    
     
  • DeerHunter
    DeerHunter
    2012-02-07

    it's " adsl_phy.bin "

     
  • DeerHunter
    DeerHunter
    2012-02-08

    I will build the modules myself ;)

     
  • DeerHunter
    DeerHunter
    2012-02-14

    I have not modified rcS yet, because it's painful to rebuild everytime I need
    to test the bootscript..
    Here's a ready-to-use source code tarball
    (it compiles perfectly on Debian
    Squeeze) (if you delete kernel/vmlnuz.a and kernel/src/vmlinux , 'make auto'
    will invoke 'make menuconfig ' so you must add built-in ext3 and jbd support
    to kernel (remember, ncurses-dev is needed for make menufconfig).. in fact the
    Makefile tends to delete old .config kernel file)... whilst tk/apps/busybox
    .config is not overwritten.. hmm.. in fact busybox .config is configurable by
    make menuconfig also ..(invoke manually).
    aaand.. the shell interpreter of the firmware seems to not understand an 'if'
    (it says 'if [ not found' ) so I had to remove the loop ...
    Also I had to make a symlink 'cut' to busybox by hand .. (it's placed in /tmp)
    .. /dev is not modifiable during runtime .. so I added the nodes for
    /dev/loop1 and /dev/loop2 in target.tgz before compiling ..
    ah.. and this is a script that works .. (an example)
    So here's the firmware (for
    testing firmware images .. not end version..)

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    #!/bin/sh
    
    /bin/ln -s /bin/busybox /tmp/cut
    
    basepath="/tmp/mod" 
    devmountpath="$basepath/dev" 
    modmountpath="$basepath/modfs"
    
    /bin/mkdir -p $devmountpath
    
        fat32=`/usr/sbin/fdisk -l | /bin/grep "FAT32" | /tmp/cut -d' ' -f1`
    
        /bin/mount -t vfat $fat32 $devmountpath 
        /bin/sleep 2 
        image="$devmountpath/mod_image.bin"
    
        /bin/mkdir -p $modmountpath 
        /bin/mount -o loop -t ext3 $image $modmountpath 
            /bin/sleep 1 
        exec /bin/echo 'Patata!'
    
     
  • Gnommo Modfs
    Gnommo Modfs
    2012-02-14

    Hi,
    great work,
    I'm glad to see your progress.
    The guy who made the porting had managed the problem of /dev in a way like
    this:

        # Copy move /dev to ramfs to make it executable
            if [ -e /tmp/tmp2 ]; then
                rm -rf /tmp/tmp2
            fi
            mkdir /tmp/tmp2
            cp -a /dev/* /tmp/tmp2/
            mount -n -t ramfs ramfs /dev
            cp -a /tmp/tmp2/* /dev
            rm -rf /tmp/tmp2
    

    This is a snipet from boot.sh inside modfs, but I think it made something
    similar also before to setup and mount the loop device.

     
  • DeerHunter
    DeerHunter
    2012-02-17

    ok, so.. here's a totally working alpha
    firmware
    ..(It is an alpha
    release.. please use at your own risk)
    and another snapshot of the used
    source
    If you need a mod_image.bin (for test purposes), get it here
    ,,
    and here's what I added to /rcS (it's extremely similar to the one you
    provided me )

    # Copy move /dev to ramfs to make it executable 
    /bin/rm -rf /tmp/tmp2 
    /bin/mkdir /tmp/tmp2 
    /bin/cp -a /dev/* /tmp/tmp2/ 
    /bin/mount -n -t ramfs ramfs /dev 
    /bin/cp -a /tmp/tmp2/* /dev 
    /bin/rm -rf /tmp/tmp2
    
    #Mounting and executing ModFS
    
    #export PATH="/sbin:/bin:/usr/sbin:/usr/bin::"
    
    basepath="/tmp/mod" 
    devmountpath="$basepath/dev"
    modmountpath="$basepath/modfs" 
    modules="/lib/modules/mod" 
    loopdev="/dev/loop0" 
    sleep 45 
    oldfat32="" counter=1 
    mkdir -p $devmountpath 
    while [ $counter -le 30 ]; do 
    fat32=`fdisk -l | grep "FAT32" | cut -d' ' -f1` 
    if [ "$fat32" != "$oldfat32" ]; then 
    # FAT32 partitions 
    for dev in $fat32; do 
    mount -t vfat $dev $devmountpath 
    sleep 2 
    image="$devmountpath/mod_image.bin" 
    if [ -f $image ]; then echo "Found on $dev" 
    insmod $modules/mbcache.ko 
    insmod $modules/jbd.ko 
    insmod $modules/ext3.ko 
    insmod $modules/loop.ko
    mknod $loopdev b 7 0
    losetup $loopdev $image
    
    mkdir -p $modmountpath 
    mount -t ext3 $loopdev $modmountpath
    
    sleep 1
    
    PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/sbin/scripts $modmountpath/boot.sh $modmountpath
    
    fi 
    echo "Not found on $dev" 
    umount $dev 
    sleep 2 
    done 
    fi 
    oldfat32=$fat32 
    counter=`expr $counter + 1` 
    sleep 1 
    done
    
     
  • Gnommo Modfs
    Gnommo Modfs
    2012-02-17

    Great job!
    If you want to automatically apply adsl settings like snr margin at boot
    you can modify and adapt those from dgn2200
    Here retrain.sh :

      1
      2
      3
      4
      5
      6
      7
      8
      9
     10
     11
     12
     13
     14
     15
     16
     17
     18
     19
     20
     21
     22
     23
     24
     25
     26
     27
     28
     29
     30
     31
     32
     33
     34
     35
     36
     37
     38
     39
     40
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
     70
     71
     72
     73
     74
     75
     76
     77
     78
     79
     80
     81
     82
     83
     84
     85
     86
     87
     88
     89
     90
     91
     92
     93
     94
     95
     96
     97
     98
     99
    100
    101
    102
    #!/bin/sh
    
    # wait until nvram is available
    while [ 1 ]; do
      res=`param get http_passwd`
      if [ "$res" != "" ]; then
        break
      fi
      sleep 1
    done
    
    SLEEP_SECONDS=25
    
    #get SNR Retrain Limit value
    RETRAIN_MIN_SNR=`nvram get adsl_retrain_min_snr`
    
    if [ "$RETRAIN_MIN_SNR" = "" ]; then
       #value not available, first time running this script set value to 5
       nvram set adsl_retrain_min_snr=5
    fi
    
    #get SNR Retrain Upper Limit
    RETRAIN_MAX_SNR=`nvram get adsl_retrain_max_snr`
    
    if [ "$RETRAIN_MAX_SNR" = "" ]; then
       #value not available, first time running this script set value to 100
       nvram set adsl_retrain_max_snr=100
    fi
    
    PREVIOUS_PING=0
    
    #infinite loop
    while [ 1 ]; do
    
       #get retrain_script variable
       RETRAIN_SCRIPT=`nvram get adsl_retrain_script`
    
       #if retrain_script not set
       if [ "$RETRAIN_SCRIPT" != "1" ]; then
          #retrain script is not active, quit
          exit 0
       fi
    
       sleep $SLEEP_SECONDS
    
       MUST_RETRAIN=0
    
       #get SNR Margin value
       SNR=`adslctl info --show | grep SNR | awk '{ print $3 }' | cut -d'.' -f1`
    
       if [ "$SNR" = "" ]; then
          #SNR Margin not available, maybe router is training line
          PREVIOUS_PING=0
          continue
       fi
    
       #get ping IP
       PING_IP=`nvram get adsl_retrain_ip`
    
       if [ "$PING_IP" != "" ]; then
          #ping an address to check network connection
          ping -c 1 $PING_IP
          PING_RESULT="$?"
          if [ "$PING_RESULT" != "0" ]; then
             if [ $PREVIOUS_PING -eq 0 ]; then
                PREVIOUS_PING=1
             else
                MUST_RETRAIN=1
                date >> /tmp/retrain.log
                echo "$PING_IP unreachable...training line" >> /tmp/retrain.log
                PREVIOUS_PING=0
             fi
          else
             PREVIOUS_PING=0      
          fi
       fi
    
       #get SNR Retrain Lower Limit
       RETRAIN_MIN_SNR=`nvram get adsl_retrain_min_snr`
       #get SNR Retrain Upper Limit
       RETRAIN_MAX_SNR=`nvram get adsl_retrain_max_snr`
    
       if [ $SNR -lt $RETRAIN_MIN_SNR ]; then
          MUST_RETRAIN=1   
          date >> /tmp/retrain.log
          echo "SNR Margin is $SNR dB and allowed range is [$RETRAIN_MIN_SNR - $RETRAIN_MAX_SNR]...training line" >> /tmp/retrain.log
       fi
    
       if [ $SNR -gt $RETRAIN_MAX_SNR ]; then
          MUST_RETRAIN=1   
          date >> /tmp/retrain.log
          echo "SNR Margin is $SNR dB and allowed range is [$RETRAIN_MIN_SNR - $RETRAIN_MAX_SNR]...training line" >> /tmp/retrain.log
       fi
    
       if [ $MUST_RETRAIN -eq 1 ]; then
          #keep in log only the last twenty retrains
          cat /tmp/retrain.log | tail -n 40 > /tmp/retrain.log.tmp
          mv /tmp/retrain.log.tmp /tmp/retrain.log
    
          adslctl start
       fi
    done
    

    Uses values stored in nvram through adsl settings package in modfs.

     
  • Gnommo Modfs
    Gnommo Modfs
    2012-02-17

    Here is the actual script that applies adsl settings
    A script with name xdslctl that replaces the original xdslctl renamed in
    xdslctl.original instead.

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    #!/bin/sh
    
    LOG_LINES=20
    
    ENABLED=`param get adsl_settings_enabled`
    
    if [ "$ENABLED" != "1" ]; then
      exec xdslctl.original $*
    fi
    
    if [ "$1" = "start" ]; then
      # read Target SNR Margin value
      ADSL_CMD="--lpair i"
      ADSL_BITSWAP=`param get adsl_bitswap`
      if [ "$ADSL_BITSWAP" = "0" ]; then
        ADSL_CMD="$ADSL_CMD --bitswap off"
      else
        ADSL_CMD="$ADSL_CMD --bitswap on"
      fi
      ADSL_SRA=`param get adsl_sra`
      if [ "$ADSL_SRA" = "1" ]; then
        ADSL_CMD="$ADSL_CMD --sra on"
      else
        ADSL_CMD="$ADSL_CMD --sra off"
      fi
      ADSL_MOD=`param get adsl_mod`
      if [ "$ADSL_MOD" != "" ]; then
        ADSL_CMD="$ADSL_CMD --mod $ADSL_MOD"
      else
        ADSL_CMD="$ADSL_CMD --mod dlt2pm"
      fi
      ADSL_SNR=`param get adsl_snr`
      if [ "$ADSL_SNR" != "" ]; then
        ADSL_CMD="$ADSL_CMD --snr $ADSL_SNR"
      fi
      ADSL_CUSTOM=`param get adsl_custom_param`
      if [ "$ADSL_CUSTOM" != "" ]; then
        ADSL_CMD="$ADSL_CMD $ADSL_CUSTOM"
      fi
    
      ADSL_CMD="$ADSL_CMD --up"
      echo "xdslctl start $ADSL_CMD" >> /tmp/lastadslcmd.log
      cat /tmp/lastadslcmd.log | tail -n $LOG_LINES > /tmp/lastadslcmd.log.new
      mv /tmp/lastadslcmd.log.new /tmp/lastadslcmd.log
      exec xdslctl.original start $ADSL_CMD 
    fi
    
    # other operations left unchanged
    exec xdslctl.original $*
    
     
  • DeerHunter
    DeerHunter
    2012-02-17

    OK, I'll try to build another version with this adsl script, during the
    weekend ;) .. Thx :D

     
  • DeerHunter
    DeerHunter
    2012-02-20

    done .. but adslctl will need some testing, though.
    http://www.mediafire.com/?078snh25zhuh2pu

    /usr/sbin/xdslctl

     #!/bin/sh 
    export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/sbin/scripts
    
    LOG_LINES=20
    
    ENABLED=`nvram get adsl_settings_enabled | cut -d'=' -f2`
    
    if [ "$ENABLED" != "1" ]; then 
      exec xdslctl.original $* 
    fi
    
    if [ "$1" = "start" ]; then
    
      ADSL_CMD="configure --lpair i"
    
      ADSL_BITSWAP=`nvram get adsl_bitswap | cut -d'=' -f2` 
      if [ "$ADSL_BITSWAP" = "0" ]; then 
        ADSL_CMD="$ADSL_CMD --bitswap off" 
      else 
        ADSL_CMD="$ADSL_CMD --bitswap on" 
      fi
    
      ADSL_SRA=`nvram get adsl_sra | cut -d'=' -f2` 
      if [ "$ADSL_SRA" = "1" ]; then 
        ADSL_CMD="$ADSL_CMD --sra on" 
      else 
        ADSL_CMD="$ADSL_CMD --sra off" 
      fi
    
      ADSL_MOD=`nvram get adsl_mod | cut -d'=' -f2` 
      if [ "$ADSL_MOD" != "" ]; then 
        ADSL_CMD="$ADSL_CMD --mod $ADSL_MOD" 
      else 
        ADSL_CMD="$ADSL_CMD --mod dlt2pm" 
      fi
    
      ADSL_SNR=`nvram get adsl_snr | cut -d'=' -f2` 
      if [ "$ADSL_SNR" != "" ]; then 
        ADSL_CMD="$ADSL_CMD --snr $ADSL_SNR" 
      fi
    
      ADSL_CUSTOM=`nvram get adsl_custom_param | cut -d'=' -f2` 
      if [ "$ADSL_CUSTOM" != "" ]; then 
        ADSL_CMD="$ADSL_CMD $ADSL_CUSTOM" 
      fi
    
      ADSL_CMD="--up $ADSL_CMD "
    
      echo "xdslctl start $ADSL_CMD" >> /tmp/lastadslcmd.log 
      cat /tmp/lastadslcmd.log | tail -n $LOG_LINES > /tmp/lastadslcmd.log.new 
      mv /tmp/lastadslcmd.log.new /tmp/lastadslcmd.log 
      exec xdslctl.original start $ADSL_CMD
    
    fi
    
    # other operations left unchanged 
    exec xdslctl.original $*
    

    /usr/sbin/retrain.sh& (invoked in rcS )

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    #!/bin/sh 
    PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/sbin/scripts
    
    # wait until nvram is available 
    while [ 1 ]; do 
    res=`nvram show` 
    if [ "$res" != "" ]; then 
    break 
    fi 
    sleep 1 
    done
    
    SLEEP_SECONDS=25
    
    #get SNR Retrain Limit value 
    RETRAIN_MIN_SNR=`nvram get adsl_retrain_min_snr | cut -d'=' -f2` 
    if [ "$RETRAIN_MIN_SNR" = "" ]; then 
    #value not available, first time running this script set value to 5 
    nvram set adsl_retrain_min_snr=5 
    fi
    
    #get SNR Retrain Upper Limit 
    RETRAIN_MAX_SNR=`nvram get adsl_retrain_max_snr | cut -d'=' -f2` 
    if [ "$RETRAIN_MAX_SNR" = "" ]; then 
    #value not available, first time running this script set value to 100 
    nvram set adsl_retrain_max_snr=100 
    fi
    
    PREVIOUS_PING=0
    
    #infinite loop 
    while [ 1 ]; do 
    #get retrain_script variable 
    RETRAIN_SCRIPT=`nvram get adsl_retrain_script | cut -d'=' -f2` 
    #if retrain_script not set 
    if [ "$RETRAIN_SCRIPT" != "1" ]; then 
    #retrain script is not active, quit 
    exit 0 
    fi 
    sleep $SLEEP_SECONDS 
    MUST_RETRAIN=0 
    #get SNR Margin value 
    SNR=`adslctl info --show | grep SNR | awk '{ print $3 }' | cut -d'.' -f1` 
    if [ "$SNR" = "" ]; then 
    #SNR Margin not available, maybe router is training line 
    PREVIOUS_PING=0 
    continue 
    fi 
    #get ping IP 
    PING_IP=`nvram get adsl_retrain_ip | cut -d'=' -f2` 
    if [ "$PING_IP" != "" ]; then 
    #ping an address to check network connection 
    ping -c 1 $PING_IP 
    PING_RESULT="$?" 
    if [ "$PING_RESULT" != "0" ]; then 
    if [ $PREVIOUS_PING -eq 0 ]; then 
    PREVIOUS_PING=1 
    else 
    MUST_RETRAIN=1 
    date >> /tmp/retrain.log 
    echo "$PING_IP unreachable...training line" >> /tmp/retrain.log 
    PREVIOUS_PING=0 
    fi 
    else PREVIOUS_PING=0 
    fi 
    fi 
    #get SNR Retrain Lower Limit 
    RETRAIN_MIN_SNR=`nvram get adsl_retrain_min_snr | cut -d'=' -f2`
     #get SNR Retrain Upper Limit 
    RETRAIN_MAX_SNR=`nvram get adsl_retrain_max_snr  | cut -d'=' -f2` 
    if [ $SNR -lt $RETRAIN_MIN_SNR ]; then 
    MUST_RETRAIN=1 
    date >> /tmp/retrain.log 
    echo "SNR Margin is $SNR dB and allowed range is [$RETRAIN_MIN_SNR - $RETRAIN_MAX_SNR]...training line" >> /tmp/retrain.log 
    fi 
    if [ $SNR -gt $RETRAIN_MAX_SNR ]; then 
    MUST_RETRAIN=1 
    date >> /tmp/retrain.log 
    echo "SNR Margin is $SNR dB and allowed range is [$RETRAIN_MIN_SNR - $RETRAIN_MAX_SNR]...training line" >> /tmp/retrain.log 
    fi 
    if [ $MUST_RETRAIN -eq 1 ]; then 
    #keep in log only the last twenty retrains 
    cat /tmp/retrain.log | tail -n 40 > /tmp/retrain.log.tmp 
    mv /tmp/retrain.log.tmp /tmp/retrain.log 
    adslctl start 
    fi 
    done
    
     
  • Gnommo Modfs
    Gnommo Modfs
    2012-02-21

    I'm looking for recruiting some testers :D

     

  • Anonymous
    2012-02-23

    Id love to test it guys, infact im reading all this trying to make a bit more
    sense of it so i can

    any chance somebody can throw up just a basic how to just to get me get a
    better understanding of this

    Cheers

     
  • Steve
    Steve
    2012-03-03

    I'm very keen to see the WAG320N altered / modified. If you need anyone to
    help give me a shout. Had a play mostly using the web page exploit / script
    and been trying to get Telnet installed on there, but this seems a very
    interesting way of accomplishing the same.

    Been following this thread for a couple of weeks, hopefully people are still
    working on this.

     
  • Gnommo Modfs
    Gnommo Modfs
    2012-03-06

    sagbohan I forgot to tell you that in order to be able to access to ssh and
    telnet
    this script is needed to be added to rcS.
    I don't know if you have already solved in some manner.

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    #!/bin/sh
    
    # wait until nvram is available
    while [ 1 ]; do
      res=`param get http_passwd`
      if [ "$res" != "" ]; then
        break
      fi
      sleep 1
    done
    
    echo "nobody:*:0:0:nobody:/:/bin/sh" > /etc/passwd
    echo "admin:$res:0:0:admin:/:/bin/sh" >> /etc/passwd
    echo "guest:guest:0:0:guest:/:/bin/nologin" >> /etc/passwd
    
     
  • DeerHunter
    DeerHunter
    2012-03-12

    thanks, gnommo ..
    I'm going to make another build (I'm also adding the /opt folder) ..

     
  • DeerHunter
    DeerHunter
    2012-03-13

    gnommo, /etc is not writable ....¿any solution? maybe boot.sh should be
    modified..

     
  • DeerHunter
    DeerHunter
    2012-03-14

    OK, OK .. I'll create a symlink of /etc/passwd to /tmp/etc/passwd ;)

     
  • DeerHunter
    DeerHunter
    2012-03-17

    It seems /etc/passwd is writable ..
    but sshd nor telnetd accept these credentials
    here's the content of /etc/passwd after boot (with the script you gave me)

    ./wag320hack.sh /bin/cat /etc/passwd
    nobody:*:0:0:nobody:/:/bin/sh
    admin:admin:0:0:admin:/:/bin/sh
    guest:guest:0:0:guest:/:/bin/nologin
    
     
  • Gnommo Modfs
    Gnommo Modfs
    2012-03-19

    I didn't understand the problem on the wag320n very well, I have only
    forwarded to you this question from some users that are not able to login to
    ssh.
    On the dgn3500 works in other way, I don't need this script that is specific
    to the dgn2200 issue, because initially the root user has no password, so I
    login in telnet with the root user and no password and then I set the password
    through passwd command and I can save this just modified /etc/passwd file to
    modfs partition, in order to recopy again it to /etc on the boot.
    After that I'm able to access to ssh with root user too.
    No other problems with other users, the original /etc/passwd file works well.

    Other question,
    it seems that on the wag320n, as on dgn3500 and despite dgn2200, it's possible
    to boot mod_image.bin on ntfs , can you try to test it? In this way,you will
    be able to use usb disks that can store larger files, in sight of the
    trasmission torrent package, that we are preparing.

     
  • DeerHunter
    DeerHunter
    2012-03-21

    here's an image that boots mod_image.bin from ntfs (minor changes to the /rcS
    ) .. and I have added an /opt folder ,, also..
    http://www.mediafire.com/?0swtr6xscc5z88r

     
1 2 > >> (Page 1 of 2)