1.安装libc
什么是libc,这里贴一个gnu官方的解释 Any Unix-like operating system needs a C library: the library which defines the ``system calls'' and other basic facilities such as open, malloc, printf, exit... The GNU C Library is used as the C library in the GNU system and in GNU/Linux systems, as well as many other systems that use Linux as the kernel.对于我们的意义就好像windows里面的.net组件,没装的话,各种软件报错。所以,我们要第一时间装好libc,那要怎么装?默认的opkg源里面没有libc,得自己下载。libc是比较接近底层的组件了,所以安装的时候硬件架构平台得严格匹配才能正常装好。 所以,我们得搞清楚路由器用的什么架构。 uname -a Linux PandoraBox 3.14.44 #1 Tue Jun 9 11:17:44 CST 2015 mips GNU/Linux 得到一个machine type 是mips ,好像也没什么用。 看看cpu的信息,sed -n 1,11p /proc/cpuinfo
图中能看出,优酷路由器使用的是联发科的MT7620A型号的芯片,机器类型属于mips类的。
也就是说,我们要装libc的话,ipk包名里面得包含有“mips_24kec”字样,遂google之,得到一个链接
https://openwrt.mirrors.ustc.edu.cn/barrier_breaker/14.07/ramips/mt7620a/packages/base/libc_0.9.33.2-1_ramips_24kec.ipk
用wget下载上面的链接,然后直接opkg install libc_0.9.33.2-1_ramips_24kec.ipk ,libc库就安装好了。装好这个东西,以后装软件,就不会报错缺少libc * * 了。
2.安装ADBYBY 安装Vwan虚拟多拨(得宽带支持才能拨号成功) shadowsocks安装(简称SS)
由于k1的硬件限制,8M的Flash。在没有硬改的情况下,路由无法安装太多的插件,包括众所周知的adbyby去广告插件。
opkg install luci-app-adbyby 这里by the way一下,带luci前缀的包都是有web管理的
opkg update
opkg install luci-app-syncdial
opkg install luci-i18n-shadowsocks-zh-cn
3.okpg
配置:
dest root /
dest ram /tmp
lists_dir ext /var/opkg-lists
option overlay_root /overlay
src/gz r2_base http://downloads.openwrt.org.cn/PandoraBox/ralink/packages/base
src/gz r2_management http://downloads.openwrt.org.cn/PandoraBox/ralink/packages/management
src/gz r2_oldpackages http://downloads.openwrt.org.cn/PandoraBox/ralink/packages/oldpackages
src/gz r2_packages http://downloads.openwrt.org.cn/PandoraBox/ralink/packages/packages
src/gz r2_routing http://downloads.openwrt.org.cn/PandoraBox/ralink/packages/routing
src/gz r2_telephony http://downloads.openwrt.org.cn/PandoraBox/ralink/packages/telephony
版本介绍:
http://code.taobao.org/svn/luci-app-adbyby/adbyby_2.7-7.0_ar71xx.ipk 为ar71xx版 http://code.taobao.org/svn/luci-app-adbyby/adbyby_2.7-7.0_arm.ipk 为arm版 http://code.taobao.org/svn/luci-app-adbyby/adbyby_2.7-7.0_armv7.ipk 为armv7版 http://code.taobao.org/svn/luci-app-adbyby/adbyby_2.7-7.0_ralink.ipk 为7620A(N)和7621潘多拉专用版 http://code.taobao.org/svn/luci-app-adbyby/adbyby_2.7-7.0_ramips_24kec.ipk 为7620A(N)和7621 OPENWRT官版专用版 http://code.taobao.org/svn/luci-app-adbyby/adbyby_2.7-7.0_x64.ipk 为X64版 http://code.taobao.org/svn/luci-app-adbyby/adbyby_2.7-7.0_x86.ipk 为X86版
命令:
opkg --force-depends --force-overwrite install /tmp/3.ipk
目前我刷的openWrt是PandoraBox 14.09 r355,是基于openWrt Barrier Breaker的。使用的原地址是
http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/
这里面有好几个文件夹,将这些源都写到/etc/opkg.conf里。我的opkg.conf文件如下 rc/gz barrier_breaker_base http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/base src/gz barrier_breaker_management http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/management src/gz barrier_breaker_oldpackages http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/oldpackages src/gz barrier_breaker_packages http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/packages src/gz barrier_breaker_routing http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/routing src/gz barrier_breaker_telephony http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/telephony dest root /data dest ram /tmp lists_dir ext /data/var/opkg-lists option overlay_root /data
保存后运行opkg update。发现源是可以链接上了,但是报出类似于如下错误
Package xxx version xxx has no valid architecture, ignoring.
源指定的architecture和路由上刷好的系统的不一致造成的。
在/etc/opkg.conf文件中加入对系统支持的architecture的设置,具体方法是添加如下几行
arch all 100
arch <arch类型1> 200
arch <arch类型2> 300
官网的意思是告诉opkg,arch类型2的包可以兼容的装在arch类型1的系统上。那么问题来了,现在的arch类型是什么呢?折腾了好久,我尝试过查看系统的arch,利用
uname -a
cat /proc/cpuinfo
cat /etc/openwrt_release
|
|
mips是指令集,sel和seb是内存大小端模式. |
mips是big-endian的mips架构,
mipsel是little-endian的mips架构。
MT7620, 设计这个芯片的公司在被MTK收购前叫ralink, ramips是ralink生产的芯片系列在openwrt中的名称,mips是具体的芯片架构
可以理解rampis为厂商名
4.开启ssh
刷完pandorabox后默认没有开启SSH功能,如果需要开启,登陆到系统管理页面,配置如下图
如果没有安装:
安装dropbear(ssh)方法: telnet登陆后输入
opkg install http://archive.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/base/dropbear_2014.63-2_ramips_24kec.ipk
ssh开机自启
/etc/init.d/dropbear enable
更改root密码, 比如admin
passwd=admin
echo -e "$passwd\n$passwd" | passwd root
启动ssh
/etc/init.d/dropbear start
5.常见错误
包与固件不兼容。要么换包,要么换固件。
下载自己路由器cpu版本的压缩包,
Unknown package 'adbyby'. Collected errors: * pkg_hash_fetch_best_installation_candidate: Packages for adbyby found, but incompatible with the architectures configured * opkg_install_cmd: Cannot install package adbyby.