一半君的总结纸

听话只听一半君

Asus RT-N66路由器”修复”电源按钮开关和添加TF(micro sd)卡

他已经坏了很久了,我用了个脑残法先顶着,最近发现保修过了,正好我想拆了加tf卡装shadowsocks

SubstandardFullSizeRender(8)

我不是一个人,只要搜rt-n66u power switch broken,就会有一大堆贴,症状就是你得用手压着开关才有电,松手就灭了
RT-N66U Power button spoilt…
Asus RT-AC66U Power Button Repair
Mechanical problems in my Asus RT-AC66U router, failing on/off switch
ASUS RT-N66U router died in a strange way today.
Broken power button
ASUS RT-N66U – How to open the case

之前他的系统已经是 Tomato Firmware 1.28.0000 MIPSR2-121 K26 USB AIO-64K,因为他是主力router,所以一直丢在那没管他,现在既然准备拆机了,就先升级一个吧
之前
rt-n66 before update
他应该是K26RT-N系列的,去Shibby的官网下载 http://tomato.groov.pl/download/K26RT-N/build5x-131-EN/Asus%20RT-N66u%2064k/
我还是继续下AIO版本,反正flash够大,没事
升级之后:
rt-n66 after update

虽然升级后jffs小了巨多,不过11mb足够了
rt-n66 jffs

话说为啥11mb够了lz还要拆机加卡?因为反正保修也过了,拆着好玩…

拆机图…直接把开关的弹簧卸了,卡住弹簧的小金属片可以直接向上抽出,把开关一直保持按下状态即可,反正我也不用开关,挺紧的,倒过来也不会自己掉出来

FullSizeRender(13)

FullSizeRender(12)

before
FullSizeRender(9)

after
FullSizeRender

装好不知道从哪里翻出来的三爽的8g的class4的tf卡之后原样装好,开机
SubstandardFullSizeRender(9)

插入…
SubstandardFullSizeRender

原样装好,按钮始终保持按下 …
FullSizeRender(8)

  1. 首先到USB and NAS-USB Support中启用相关设置,似乎默认就已经开了
    rt-n66 usb support
  2. 看了一组教程以后觉得目前比较好的做法是 tf卡用ext2不分区,swap和data放在外置u盘上用ext3,以避免tf卡被写太多爆掉
    # 插优盘之后,sandisk cruzer blade 4g
    # 8g的是刚放进去的三爽micro sd卡
    root@unknown:/tmp/home/root# fdisk -l
    
    Disk /dev/sda: 7892 MB, 7892631552 bytes
    143 heads, 15 sectors/track, 7186 cylinders
    Units = cylinders of 2145 * 512 = 1098240 bytes
    
       Device Boot      Start         End      Blocks  Id System
    /dev/sda1               4        7187     7703552   b Win95 FAT32
    
    Disk /dev/sdb: 4022 MB, 4022337024 bytes
    255 heads, 63 sectors/track, 489 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot      Start         End      Blocks  Id System
    /dev/sdb4   *           1         490     3927935+  b Win95 FAT32
    Partition 4 has different physical/logical endings:
         phys=(488, 254, 63) logical=(489, 5, 27)
    

    tf卡我不准备分区,所以直接把他格了

    # 进去把所有分区都删了
    fdisk /dev/sda
    
    # 把u盘上所有分区删了,建一个512mb的swap,剩下的全给data
    fdisk /dev/sdb
    

    重启以后u盘变成sda了

    mkfs.ext2 -m 1 -L entware /dev/sdb1
    mkfs.ext3 -m 1 -L data /dev/sda2
    mkswap -L swap /dev/sda1
    

    完成效果

    root@unknown:/tmp/home/root# fdisk -l
    
    Disk /dev/sda: 4022 MB, 4022337024 bytes
    255 heads, 63 sectors/track, 489 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    
       Device Boot      Start         End      Blocks  Id System
    /dev/sda1               1          63      506016  82 Linux swap
    /dev/sda2              64         489     3421845  83 Linux
    
    Disk /dev/sdb: 7892 MB, 7892631552 bytes
    143 heads, 15 sectors/track, 7186 cylinders
    Units = cylinders of 2145 * 512 = 1098240 bytes
    
       Device Boot      Start         End      Blocks  Id System
    /dev/sdb1               1        7186     7706977+ 83 Linux
    
    

    tomato webui里要打开自动挂载,重启后

    root@unknown:/tmp/home/root# df -h
    Filesystem                Size      Used Available Use% Mounted on
    /dev/root                19.1M     19.1M         0 100% /
    tmpfs                   124.9M    456.0K    124.4M   0% /tmp
    devfs                   124.9M         0    124.9M   0% /dev
    /dev/mtdblock3           11.5M    516.0K     11.0M   4% /jffs
    /dev/sda2                 3.2G     64.1M      3.1G   2% /tmp/mnt/data
    /dev/sdb1                 7.2G     20.0K      7.2G   0% /tmp/mnt/entware
    

    此外如果重启后swap没启用,可以去/etc/fstab里加上

    #device Mountpoint FStype Options Dump Pass#
    LABEL=swap none swap sw 0 0
    

    然后将此文件存在nvram里

    nvram setfile2nvram /etc/fstab
    nvram commit
    reboot
    

    总之如果swap激活后,overview里看起来是这样的
    swap enabled

  3. 下面来装个entware,纯粹试验,我不会在路由器上编译ss的,太慢
    首先要在tomato里做如下设置

    1. NAS > USB Support WebUI 里勾上
      [x] Core USB Support
      [x] USB 2.0 Support
      [x] USB Storage Support
      [x] Ex2/Ext3 File Systems Support
      [x] Automount
      
    2. Run after mounting 里:
      #!/bin/sh
      /opt/etc/init.d/rc.unslung start
      
    3. Run before unmounting 里:

      #!/bin/sh
      /opt/etc/init.d/rc.unslung stop
      sleep 15
      for i in `cat /proc/mounts | awk '$3 ~ /ext[23]/ {print($1)}'` ; do
        mount -o remount,ro $i
      done
      
    4. 保存以后去到 Administration > Scripts > Init 里
      echo "LABEL=entware /opt ext2 defaults 1 1" >> /etc/fstab
      
    5. 重启安装entware

      root@unknown:/opt# wget -O - http://entware.wl500g.info/binaries/mipselsf/installer/entware_install.sh | sh
      
      Connecting to entware.wl500g.info (81.4.122.163:80)
      -                    100% |***********************************************************************|  1143   0:00:00 ETA
      Info: Checking for prerequisites and creating folders...
      Info: Opkg package manager deployment...
      Connecting to entware.wl500g.info (81.4.122.163:80)
      opkg                 100% |***********************************************************************|   476k  0:00:00 ETA
      Connecting to entware.wl500g.info (81.4.122.163:80)
      opkg.conf            100% |***********************************************************************|   107   0:00:00 ETA
      Info: Basic packages installation...
      Downloading http://entware.wl500g.info/binaries/mipselsf/Packages.gz.
      Updated list of available packages in /opt/var/opkg-lists/mipselsf.
      Installing uclibc-opt (0.9.32-5) to root...
      Downloading http://entware.wl500g.info/binaries/mipselsf/uclibc-opt_0.9.32-5_mipselsf.ipk.
      Installing libc (0.9.32-2) to root...
      Downloading http://entware.wl500g.info/binaries/mipselsf/libc_0.9.32-2_mipselsf.ipk.
      Installing libgcc (4.6.4-2) to root...
      Downloading http://entware.wl500g.info/binaries/mipselsf/libgcc_4.6.4-2_mipselsf.ipk.
      Installing libstdcpp (4.6.4-2) to root...
      Downloading http://entware.wl500g.info/binaries/mipselsf/libstdcpp_4.6.4-2_mipselsf.ipk.
      Installing libpthread (0.9.32-2) to root...
      Downloading http://entware.wl500g.info/binaries/mipselsf/libpthread_0.9.32-2_mipselsf.ipk.
      Installing librt (0.9.32-2) to root...
      Downloading http://entware.wl500g.info/binaries/mipselsf/librt_0.9.32-2_mipselsf.ipk.
      Installing ldconfig (0.9.32-2) to root...
      Downloading http://entware.wl500g.info/binaries/mipselsf/ldconfig_0.9.32-2_mipselsf.ipk.
      Installing findutils (4.5.14-1) to root...
      Downloading http://entware.wl500g.info/binaries/mipselsf/findutils_4.5.14-1_mipselsf.ipk.
      Configuring ldconfig.
      Configuring libgcc.
      Configuring libc.
      Configuring libpthread.
      Configuring libstdcpp.
      Configuring librt.
      Configuring findutils.
      Configuring uclibc-opt.
      Updating /opt/etc/ld.so.cache... done.
      Info: Cleanup...
      Info: Congratulations!
      Info: If there are no errors above then Entware successfully initialized.
      Info: Found a Bug? Please report at https://github.com/Entware/entware/issues
      

      然后就可以用opkg装各种乱搞软件了

    6. 但是lz的目的是用他反向使用ss翻回国内,恰好这台也是mipsel架构,上篇折腾出来的工具链和编译出来的ss在这台也可用(省了不少事)

参考:

RT-N66U+tomato安装optware流水账
华硕路由器(Asus Router)RT-N66U 内置microSD(TF)卡插槽使用攻略
Asus RT-N66 – OpenWRT Wiki
MySQL server on RT-N66U or RT-AC66U for shared XBMC library
Optware or Entware – SmallNetBuilder
Entware – Github Repo
在华硕路由器Asuswrt上安装Entware-mipsel (此方法仅mipsel 平台)
What partitions should I have on my SDcard
Reserved space for root on a filesystem – why?
How To Fix “Warning: Re-reading the partition table failed with error 22: Invalid argument” Error on Linux
USB Storage setup – entware

Advertisements

3 responses to “Asus RT-N66路由器”修复”电源按钮开关和添加TF(micro sd)卡

  1. houzi123 九月 15, 2015 @ 7:54 下午

    可以直接短接12v+GNU线路!真是太悲催了!

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: