启用刷了dd-wrt的无线路由器asus-n13u-b1外置usb存储支持,安装python2.7

硬件版本
华硕 N13U Rev B1
root@n13u:/tmp/mnt/sda_part1# cat /proc/cpuinfo
system type        : Ralink RT3052   id:1 rev:3
processor        : 0
cpu model        : MIPS 24KEc V4.12
BogoMIPS        : 255.59
CPUClock        : 384
wait instruction    : yes
microsecond timers    : yes
tlb_entries        : 32
extra interrupt vector    : yes
hardware watchpoint    : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
ASEs implemented    : mips16
shadow register sets    : 1
kscratch registers    : 0
core            : 0
VCED exceptions        : not available
VCEI exceptions        : not available

root@n13u:/tmp/mnt/sda_part1# cat /proc/meminfo
        total:    used:    free:  shared: buffers:  cached:
Mem:  63430656 47083520 16347136        0  3416064 26578944
Swap:        0        0        0
MemTotal:          61944 kB
MemFree:           15964 kB
...


网页装安装ddwrt,直接上传ddwrt安装文件等上两分钟就可,本文所用dd-wrt版本
root@n13u:/tmp/mnt/sda_part1# cat /proc/version

Linux version 3.2.23-svn19518 (root@dd-wrt) (gcc version 4.6.3 20120201 (prerelease) (Linaro GCC 4.6-2012.02) ) #1369 Fri Jul 20 13:15:41 CEST 2012


登录ddwrt主页,启用所有usb支持
PATH:Services -> USB Support
Enable如下4项,保存,应用
Core USB Support
USB Printer Support
USB Storage Support
Automatic Drive Mount


分区,格式化u盘
fdisk /dev/sdb
mkfs.ext3 /dev/sdb1


开启路由器的sshd服务
PATH:Services -> Services -> Secure Shell
Enable SSHd,保存,应用


ssh登录到路由器,挂载jffs和opt到u盘文件夹
root@n13u:/tmp/mnt/sda_part1# mount -o bind /tmp/mnt/sda_part1/jffs/ /jffs/
root@n13u:/tmp/mnt/sda_part1# mount -o bind /tmp/mnt/sda_part1/opt/ /opt/
root@n13u:/tmp/mnt/sda_part1# ls -l
drwxr-xr-x    2 root     root          4096 Jan 20 12:30 jffs
drwx------    2 root     root         16384 Jan 20 10:59 lost+found
drwxr-xr-x    9 root     root          4096 Jan 20 12:59 opt
root@n13u:/tmp/mnt/sda_part1# mount
rootfs on / type rootfs (rw)
/dev/root on / type squashfs (ro,relatime)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
ramfs on /tmp type ramfs (rw,relatime)
none on /dev type tmpfs (rw,relatime,size=512k)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
devpts on /proc/bus/usb type usbfs (rw,relatime)
/dev/sda1 on /tmp/mnt/sda_part1 type ext2 (rw,relatime,errors=continue)
/dev/sda2 on /tmp/mnt/sda_part2 type ext2 (rw,relatime,errors=continue)
/dev/sda1 on /jffs type ext2 (rw,relatime,errors=continue)
/dev/sda1 on /opt type ext2 (rw,relatime,errors=continue)
root@n13u:/tmp/mnt/sda_part1# df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                    5.6M      5.6M         0 100% /
/dev/root                 5.6M      5.6M         0 100% /
none                    512.0K         0    512.0K   0% /dev
/dev/sda1                 4.9G    141.4M      4.5G   3% /tmp/mnt/sda_part1
/dev/sda2                 9.8G    150.6M      9.2G   2% /tmp/mnt/sda_part2
/dev/sda1                 4.9G    141.4M      4.5G   3% /jffs
/dev/sda1                 4.9G    141.4M      4.5G   3% /opt
root@n13u:/tmp/mnt/sda_part1#


下载并安装ipkg和ipkg-opt程序
root@n13u:/tmp/mnt/sda_part1# wget http://www.3iii.dk/linux/optware/optware-inst
all-ddwrt.sh -O - | tr -d '\r' > /tmp/optware-install.sh
root@n13u:/tmp/mnt/sda_part1# sh /tmp/optware-install.sh
root@n13u:/tmp/mnt/sda_part1# ls -l /opt/
drwxr-xr-x    2 root     root          4096 Jan 20 12:42 bin
drwxr-xr-x    2 root     root          4096 Jan 20 12:42 etc
drwx------    2 root     root          4096 Jan 20 12:44 ipkg-XWG13o
drwxr-xr-x    3 root     root          4096 Jan 20 12:42 lib
drwxr-xr-x    2 root     root          4096 Jan 20 12:42 sbin
drwxr-xr-x    3 root     root          4096 Feb 18  2012 share
drwxr-xr-x    3 root     root          4096 Feb 16  2012 usr
root@n13u:/tmp/mnt/sda_part1# ls -l /opt/bin/
-rwxr-xr-x    1 root     root          3852 Feb 18  2012 ipkg
lrwxrwxrwx    1 root     root             4 Jan 20 12:42 ipkg-opt -> ipkg
-rwxr-xr-x    1 root     root          4248 Feb 18  2012 update-alternatives
root@n13u:/tmp/mnt/sda_part1#


安装python2.7
root@n13u:/tmp/mnt/sda_part1# ipkg list | grep python27
python27 - 2.7.3-1 - Python is an interpreted, interactive, object-oriented programming language.
root@n13u:/tmp/mnt/sda_part1# cat /etc/ipkg.conf
src whiterussian http://downloads.openwrt.org/whiterussian/packages
src non-free http://downloads.openwrt.org/whiterussian/packages/non-free
src backports http://downloads.openwrt.org/backports/rc5
dest root /jffs
dest smbfs /tmp/smbshare
dest ram /tmp
root@n13u:/tmp/mnt/sda_part1# ipkg install python27
Installing python27 (2.7.3-1) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/python27_2.7.3-1_mipsel.ipk
Installing readline (6.1-2) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/readline_6.1-2_mipsel.ipk
Installing ncurses (5.7-3) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/ncurses_5.7-3_mipsel.ipk
Installing bzip2 (1.0.6-1) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/bzip2_1.0.6-1_mipsel.ipk
Installing openssl (0.9.7m-6) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/openssl_0.9.7m-6_mipsel.ipk
Installing libdb (4.2.52-3) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/libdb_4.2.52-3_mipsel.ipk
Installing zlib (1.2.5-1) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/zlib_1.2.5-1_mipsel.ipk
Installing sqlite (3.7.14.1-1) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/sqlite_3.7.14.1-1_mipsel.ipk
Installing ncursesw (5.7-2) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ddwrt/cross/stable/ncursesw_5.7-2_mipsel.ipk
Configuring bzip2
/opt/bin/update-alternatives: line 185: sort: not found
update-alternatives: removing //opt/bin/bzip2 as no more alternatives exist for it
Configuring libdb
Configuring ncurses
/opt/bin/update-alternatives: line 185: sort: not found
update-alternatives: removing //opt/bin/clear as no more alternatives exist for it
Configuring ncursesw
Configuring openssl
Configuring python27
Configuring readline
Configuring sqlite
Configuring zlib
Successfully terminated.
root@n13u:/tmp/mnt/sda_part1# python2
Python 2.7.3 (default, Apr 12 2012, 13:34:28)
[GCC 4.1.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print "Hello World!"
Hello World!
>>> quit()
root@n13u:/tmp/mnt/sda_part1#



REF:

1. Asus RT-N13U
http://dd-wrt.ca/wiki/index.php/Asus_RT-N13U

2. USB storage
http://www.dd-wrt.com/wiki/index.php/USB_storage

3. Ipkg (tutorial)
http://www.dd-wrt.com/wiki/index.php/Ipkg_%28tutorial%29

4. Journalling Flash File System
http://www.dd-wrt.com/wiki/index.php/Jffs

你可能感兴趣的:(启用刷了dd-wrt的无线路由器asus-n13u-b1外置usb存储支持,安装python2.7)