目 录CONTENT

文章目录

OpenWrt

GrantLi
2018-08-01 / 0 评论 / 2 点赞 / 708 阅读 / 8868 字 / 正在检测是否收录...

Abstract: “OpenWrt固件及OpenWrt相关插件的教程”

前提

1.先看看OpenWrt支持的路由器Table of Hardware
2.OpenWrt固件下载地址Table of Hardware: Firmware downloads

3.极路由要申请一个开发者模式,教程参考极路由怎么申请开发者权限?
4.安装putty软件
Windowns下的直接到官网下载软件并安装就可以了
ubuntu系统的安装如下:

sudo apt-get install putty

然后在搜索那里(按win键)找到软件打开就ok了

刷OpenWrt

用putty登录路由器后台(以SSH方式登录)

这个ip是你给极路由设定的,默认是192.168.199.1,用户名为:root,密码为路由器后台密码

刷解锁版不死U-Root

进固件作者网站查找对应u-boot:Index of /roms/uboot/

安装(以极路由1S为例)

#连上路由器后台,进入tmp目录下
cd /tmp
#下载对应版本的U-Root
wget http://rssn.cn/roms/uboot/HC5661-uboot.bin
#安装U-Root
mtd write HC5661-uboot.bin u-boot
刷OpenWrt固件

1.查看一下路由器CPU的型号,以确定我们要刷什么版本的固件

cat /proc/cpuinfo

2.进入Table of Hardware: Firmware downloads
查找cpu和型号对应的固件,并复制固件地址

#下载固件
wget http://downloads.lede-project.org/releases/17.01.4/targets/ramips/mt7620/lede-17.01.4-ramips-mt7620-hc5661-squashfs-sysupgrade.bin
#刷机
sysupgrade -F -n lede-17.01.4-ramips-mt7620-hc5661-squashfs-sysupgrade.bin

等待几分钟,当路由器自动重启说明成功(期间不要断开电源,不然就变砖了)

安装OpenWrt插件

用法:下载需要安装的插件的源代码,并编译。编译完成后去bin/ramips/packages里面找到对应的ipk,上传到路由器:

opkg install packagename
OpenWrt插件
opkg update

1.安装中文支持
system–software
Update lists 更新软件列表
Filter 填 luci-i18n-base-zh-cn 然后搜索 Find packae

2.换主题
luci-theme-material

3.安装shadowsocks
增加aa65535配置的SourceForge源

src/gz openwrt_dist_luci http://openwrt-dist.sourceforge.net/packages/luci

使用方法

#LEDE 执行命令:
wget --no-check-certificate https://raw.githubusercontent.com/gatoslu/Autoconfig-OpenWrt-LEDE/master/autoconfig_lede.sh

chmod +x autoconfig_lede.sh

./autoconfig.sh

#OpenWrt 执行命令:
wget --no-check-certificate https://raw.githubusercontent.com/gatoslu/Autoconfig-OpenWrt-LEDE/master/autoconfig_openwrt.sh

chmod +x autoconfig_openwrt.sh

./auconfig_openwrt.sh

参考链接:Autoconfig-OpenWrt-LEDE

4.使用openwrt屏蔽广告(包括视频前的广告)

使用openwrt屏蔽广告(包括视频前的广告)

OpenWrt社区介绍

1.LEDE论坛

2.OpenWrt论坛

3.OpenWrt 中文网

4.OpenWrt

5.OpenWrt下载网

6.中国无线论坛

救砖教程

意外:救砖教程

openwrt-SDK安装与配置

OpenWrt-SDK官网:OpenWrt-SDK

其他路由器chaos_calmer/15.05

配置教程

#解压文件夹
tar xjf OpenWrt-SDK-15.05-ramips-mt7628_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64.tar.bz2
cd ./OpenWrt-SDK-15.05-ramips-mt7628_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/

#安装 
feeds ./scripts/feeds update packages 
./scripts/feeds install libpcre

可能出现的错误:

WARNING: Makefile 'package/linux/Makefile' has a dependency on 'r8169-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'e100-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'bnx2-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'ar3k-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'mwifiex-sdio-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'kmod-phy-bcm-ns-usb2', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'edgeport-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'kmod-phy-bcm-ns-usb3', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'prism54-firmware', which does not exist
WARNING: Makefile 'package/linux/Makefile' has a dependency on 'rtl8192su-firmware', which does not exist
tmp/.config-package.in:36:warning: ignoring type redefinition of 'PACKAGE_libc' from 'boolean' to 'tristate'
tmp/.config-package.in:64:warning: ignoring type redefinition of 'PACKAGE_libgcc' from 'boolean' to 'tristate'
tmp/.config-package.in:149:warning: ignoring type redefinition of 'PACKAGE_libpthread' from 'boolean' to 'tristate'

解决方法:

cd openwrt/
cp feeds.conf.default feeds.conf

将feeds.conf文件修改如下:

src-git base git://git.openwrt.org/openwrt/openwrt.git;v18.06.1
src-git packages git://git.openwrt.org/feed/packages.git^35e0b737ab496f5b51e80079b0d8c9b442e223f5
src-git luci git://git.openwrt.org/project/luci.git^f64b1523447547032d5280fb0bcdde570f2ca913
src-git routing git://git.openwrt.org/feed/routing.git^1b9d1c419f0ecefda51922a7845ab2183d6acd76
src-git telephony git://git.openwrt.org/feed/telephony.git^b9d7b321d15a44c5abb9e5d43a4ec78abfd9031b
src-git wrtnode https://github.com/WRTnode/openwrt-packages.git

添加软件扩展包:

./scripts/feeds update -a
./scripts/feeds install -a
编译
make package/xx/compile V=99

问题1:

/home/gjxs/openwrt_ws/openwrt/include/toplevel.mk:167: recipe for target 'staging_dir/host/.prereq-build' failed
make: *** [staging_dir/host/.prereq-build] Error 1
/bin/sh: 3: mkhash: not found
Collecting package info: done
/bin/sh: 3: mkhash: not found

解决方法:
删除GCC,重新安装就好了


参考链接
1.极路由2刷OpenWrt的折腾之路
2. Ubuntu 使用Openwrt SDK交叉编译ipk包过程全纪录(超多图)
3.编译OpenWRT过程问题解决


2

评论区