找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 47820|回复: 103

简单说一下OpenWrt移植石像鬼QoS的方法

 火.. [复制链接]
发表于 2016-1-14 20:51 | 显示全部楼层 |阅读模式
本帖最后由 wukaisky 于 2016-10-13 10:34 编辑

准备工作,我以Debian Linux操作系统做演示

打开终端
  1. sudo apt-get update
  2. sudo apt-get install libtool autoconf automake gcc-multilib bison screen gcc g++ binutils patch bzip2 flex make gettext unzip libc6 git-core git subversion build-essential libncurses5-dev zlib1g-dev gawk quilt asciidoc libz-dev debhelper pkg-config libssl-dev gperf
复制代码

  1. cd
  2. mkdir openwrt
  3. cd openwrt
  4. git clone git://git.openwrt.org/15.05/openwrt.git chaos_calmer
  5. cd chaos_calmer
  6. ./scripts/feeds update -a
  7. ./scripts/feeds install -a
  8. git pull
复制代码

  1. cd
  2. git clone https://github.com/ericpaulbishop/gargoyle.git
复制代码

  1. cd
  2. mkdir 981213
  3. cd 981213
  4. git clone https://github.com/981213/openwrt.git
  5. cd openwrt
  6. ./scripts/feeds update -a
  7. ./scripts/feeds install -a
  8. git pull
复制代码

  1. cd
  2. cd openwrt/chaos_calmer/package
  3. mkdir my_package
复制代码


切换到主文件夹,进入gargoyle目录
复制netfilter-match-modules文件夹到openwrt/chaos_calmer目录
进入gargoyle的patches-generic目录,复制010-imq.patch和020-layer7-conntrack-adjust.patch两个文件到openwrt/chaos_calmer目录



在openwrt/chaos_calmer/package/my_package目录下,建立gargoyle文件夹

这时转回主文件夹,进入gargoyle的package文件夹,复制bwmon-gargoyle、gargoyle-firewall-util、libericstools、libiptbwctl、qos-gargoyle、webmon-gargoyle这六个文件夹到主文件夹的openwrt/chaos_calmer/package/my_package/gargoyle目录下


  1. cd
  2. cd openwrt/chaos_calmer

  3. patch -p1 < 010-imq.patch
  4. patch -p1 < 020-layer7-conntrack-adjust.patch

  5. cd netfilter-match-modules
  6. sh integrate_netfilter_modules.sh ~/openwrt/chaos_calmer ~/openwrt/chaos_calmer/netfilter-match-modules
复制代码

那个sh批处理原理就是
sh   integrate_netfilter_modules.sh    openwrt源码目录     integrate_netfilter_modules.sh所在目录
检查openwrt/chaos_calmer/target/linux/generic/config-3.18文件最底下有没有这么几行文字:
  1. CONFIG_IP_NF_MATCH_WEBURL=m
  2. CONFIG_IP_NF_MATCH_WEBMON=m
  3. CONFIG_IP_NF_MATCH_TIMERANGE=m
  4. CONFIG_IP_NF_MATCH_LAYER7=m
  5. CONFIG_IP_NF_MATCH_BANDWIDTH=m
复制代码
没有就加上



打补丁,只可运行一次,它这个脚本打补丁好像不可以自动识别是否已经打过,会重复的打,所以会造成编译过程里出错。
如果真的出错了,那还是建议重新下载源码从头开始。

切换到openwrt/chaos_calmer/target/linux/ar71xx/patches-3.18目录,剪切650-custom_netfilter_match_modules.patch文件到openwrt/chaos_calmer/target/linux/generic/patches-3.18目录下


切换到主文件夹,进入981213/openwrt/feeds/luci/applications文件夹,复制luci-app-qos_gargoyle文件夹到主文件夹的openwrt/chaos_calmer/feeds/luci/applications文件夹下
蝈蝈的石像鬼QoS已不兼容CC版,用这个包来代替:




  1. cd
  2. cd openwrt/chaos_calmer
  3. git pull
  4. ./scripts/feeds update -a
  5. ./scripts/feeds install -a
  6. make menuconfig
复制代码
注意选中  kmod-ebtables-ipv4模块,位置在:Kernel modules  --->     Netfilter Extensions  --->         kmod-ebtables-ipv4



以及选中 iptables-mod-layer7模块,位置在:Network  --->      Firewall  --->    iptables --->   iptables-mod-layer7


选中ebtables模块,位置在:Network  --->      Firewall  --->  ebtables


还有选中l7-protocols模块,位置在:Network  --->      Firewall  --->  l7-protocols


保存为. config文件,教程结束

可以看到编译luci的app下面多了luci-app-qos_gargoyle,接下来该干什么你们应该知道了吧。












如何配置石像鬼QoS可以看我另外一个帖子https://www.right.com.cn/forum/thread-176419-1-1.html

顺便说一下,如果是Barrier breaker想要移植石像鬼QoS的话,gargoyle得用1.8版本的

方法是:

进入主文件夹

  1. cd
  2. git clone https://github.com/ericpaulbishop/gargoyle.git gargoyle-1.8
  3. cd gargoyle-1.8
  4. git checkout 1.8
复制代码

然后复制相应的文件到该去的地方。

注意:1.8版石像鬼没有020-layer7-conntrack-adjust.patch这个文件,所以就不要费心的去找了。

对于采用石像鬼1.8源码的Barrier breaker来说由于石像鬼1.8 QoS依赖ip-full,而OpenWrt默认依赖ip

如果不想让路由器同时出现ip和ip-full两个重复的程序,那就得手动修改除qos-gargoyle Makefile以外,所有触及到依赖ip的Makefile文件,把+ip 全部改成+!PACKAGE_ip-full:ip

快速查找包含+ip的Makefile的方法是:

在openwrt主目录里面

  1. grep -rl "+ip "
复制代码


Barrier Breaker用的石像鬼QoS的Makefile文件需要修改一下
位置openwrt/barrier_breaker/feeds/luci/applications/luci-qos_gargoyle
修改为
  1. PO = qos_gargoyle

  2. include ../../build/config.mk
  3. include ../../build/module.mk
复制代码


另外一处修改位置为:
openwrt/barrier_breaker/feeds/luci/contrib/package/luci

在适当的地方添加:
  1. $(eval $(call application,qos_gargoyle,LuCI Support for  qos-gargoyle,\
  2.         +PACKAGE_luci-app-qos_gargoyle:qos-gargoyle))
复制代码


最后附上与石像鬼QoS相关的文件,仅供参考,不建议直接覆盖原文件:







本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×

评分

参与人数 8恩山币 +21 收起 理由
feng*** + 3 我对你的敬仰犹如江水滔滔,我上朝鲜战场后一定写信给你!!!
Hugo*** + 1 我来恩山就是为了看你!
skyg*** + 1 亲,你太牛逼了,走,我请你吃鳇鱼头去~~~
pr*** + 3 非常好。
乌*** + 10 好帖,不过最新加入的L7,编译貌似还有点问题
兔*** + 1 技术贴,必须顶!
好猫*** + 1 论坛有你更精彩
f*** + 1 城会玩

查看全部评分

我的恩山、我的无线 The best wifi forum is right here.
发表于 2016-1-14 22:04 | 显示全部楼层
这样编译后等于openwrt界面就是多了一个石像鬼的QOS程序??

点评

是的 比较适合高通和博通芯片,石像鬼官方是不支持联发科的。  详情 回复 发表于 2016-1-14 22:28
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2016-1-14 22:28 | 显示全部楼层
本帖最后由 wukaisky 于 2017-12-15 15:29 编辑
gatalon 发表于 2016-1-14 22:04
这样编译后等于openwrt界面就是多了一个石像鬼的QOS程序??

是的
比较适合高通创锐讯和博通芯片,联发科芯片也可以编译进去跑。

点评

AR的芯片应该可以的吧,另外能不能截个图看看呢?  详情 回复 发表于 2016-1-15 09:30
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-1-14 23:10 | 显示全部楼层
本帖最后由 f0x 于 2016-1-15 18:40 编辑

哇 lz太神了 这两天正好卡在编译过不去的地方,正在翻文章,居然就有了,先支持个
已成功编译,100M开qos speedtest测试损失大约10mbps带宽,换来另一台机器约少50ms的延迟(不开70多 还算不错

点评

你使用bb吗,,,我用cc不行  详情 回复 发表于 2016-2-11 11:08
祝贺你,OpenWrt编译也不是十分复杂的。  详情 回复 发表于 2016-1-15 20:25
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-1-14 23:43 | 显示全部楼层
先支持个
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-1-15 07:11 来自手机 | 显示全部楼层
收藏了,感谢楼主分享!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-1-15 09:30 | 显示全部楼层
wukaisky 发表于 2016-1-14 22:28
是的
比较适合高通创锐讯和博通芯片,石像鬼官方是不支持联发科的。当然联发科芯片也可以编译进去跑。

AR的芯片应该可以的吧,另外能不能截个图看看呢?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2016-1-15 20:25 | 显示全部楼层
f0x 发表于 2016-1-14 23:10
哇 lz太神了 这两天正好卡在编译过不去的地方,正在翻文章,居然就有了,先支持个
已成功编译,100M开qos  ...

祝贺你,OpenWrt编译也不是十分复杂的。

点评

f0x
之前一直卡在patch的地方,关键不知道改哪几个文件,走了好多弯路,再次感谢,本来我都准备要发帖问了  详情 回复 发表于 2016-1-15 21:53
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-1-15 21:53 | 显示全部楼层
wukaisky 发表于 2016-1-15 20:25
祝贺你,OpenWrt编译也不是十分复杂的。

之前一直卡在patch的地方,关键不知道改哪几个文件,走了好多弯路,再次感谢,本来我都准备要发帖问了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-1-15 23:30 | 显示全部楼层
很好的教程,这样就能实时跟进了。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-1-16 00:37 | 显示全部楼层
非常谢谢LZ的教程,早几天在LZ的帖子里面我问到了关于石像鬼QOS集城的方法,LZ今天特意开了一帖,非常感谢
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-1-16 08:41 来自手机 | 显示全部楼层
支持楼主
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-1-17 11:04 | 显示全部楼层
很好的帖子,顶一下1!!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-1-17 12:10 | 显示全部楼层
完全按照教程,编译不过
  1. [fsyx@localhost chaos_calmer]$ make V=s
  2. Collecting package info: done
  3. make[1]: Entering directory `/home/fsyx/chaos_calmer'
  4. make[2]: Entering directory `/home/fsyx/chaos_calmer'
  5. make[3]: Entering directory `/home/fsyx/chaos_calmer/target/linux'
  6. make[4]: Entering directory `/home/fsyx/chaos_calmer/target/linux/ar71xx'
  7. if [ -s "/home/fsyx/chaos_calmer/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/linux-3.18.23/patches/series" ]; then (cd "/home/fsyx/chaos_calmer/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/linux-3.18.23"; if quilt --quiltrc=- next >/dev/null 2>&1; then quilt --quiltrc=- push -a; else quilt --quiltrc=- top >/dev/null 2>&1; fi ); fi
  8. Applying patch platform/650-custom_netfilter_match_modules.patch
  9. patching file net/ipv4/netfilter/Kconfig
  10. Hunk #1 FAILED at 389.
  11. 1 out of 1 hunk FAILED -- rejects in file net/ipv4/netfilter/Kconfig
  12. patching file net/ipv4/netfilter/Makefile
  13. Hunk #1 FAILED at 53.
  14. 1 out of 1 hunk FAILED -- rejects in file net/ipv4/netfilter/Makefile
  15. The next patch would create the file net/ipv4/netfilter/ipt_weburl.c,
  16. which already exists!  Applying it anyway.
  17. patching file net/ipv4/netfilter/ipt_weburl.c
  18. Hunk #1 FAILED at 1.
  19. 1 out of 1 hunk FAILED -- rejects in file net/ipv4/netfilter/ipt_weburl.c
  20. The next patch would create the file net/ipv4/netfilter/ipt_weburl.mod.c,
  21. which already exists!  Applying it anyway.
  22. patching file net/ipv4/netfilter/ipt_weburl.mod.c
  23. Hunk #1 FAILED at 1.
  24. 1 out of 1 hunk FAILED -- rejects in file net/ipv4/netfilter/ipt_weburl.mod.c
  25. The next patch would create the file net/ipv4/netfilter/weburl_deps/regexp.c,
  26. which already exists!  Applying it anyway.
  27. patching file net/ipv4/netfilter/weburl_deps/regexp.c
  28. Hunk #1 FAILED at 1.
  29. 1 out of 1 hunk FAILED -- rejects in file net/ipv4/netfilter/weburl_deps/regexp.c
  30. The next patch would create the file net/ipv4/netfilter/weburl_deps/regexp.h,
  31. which already exists!  Applying it anyway.
  32. patching file net/ipv4/netfilter/weburl_deps/regexp.h
  33. Hunk #1 FAILED at 1.
  34. 1 out of 1 hunk FAILED -- rejects in file net/ipv4/netfilter/weburl_deps/regexp.h
  35. The next patch would create the file net/ipv4/netfilter/weburl_deps/regmagic.h,
  36. which already exists!  Applying it anyway.
  37. patching file net/ipv4/netfilter/weburl_deps/regmagic.h
  38. Hunk #1 FAILED at 1.
  39. 1 out of 1 hunk FAILED -- rejects in file net/ipv4/netfilter/weburl_deps/regmagic.h
  40. The next patch would create the file net/ipv4/netfilter/weburl_deps/regsub.c,
  41. which already exists!  Applying it anyway.
  42. patching file net/ipv4/netfilter/weburl_deps/regsub.c
  43. Hunk #1 FAILED at 1.
  44. 1 out of 1 hunk FAILED -- rejects in file net/ipv4/netfilter/weburl_deps/regsub.c
  45. The next patch would create the file net/ipv4/netfilter/weburl_deps/tree_map.h,
  46. which already exists!  Applying it anyway.
  47. patching file net/ipv4/netfilter/weburl_deps/tree_map.h
  48. Hunk #1 FAILED at 1.
  49. 1 out of 1 hunk FAILED -- rejects in file net/ipv4/netfilter/weburl_deps/tree_map.h
  50. The next patch would create the file net/ipv4/netfilter/ipt_webmon.c,
  51. which already exists!  Applying it anyway.
  52. patching file net/ipv4/netfilter/ipt_webmon.c
  53. Hunk #1 FAILED at 1.
  54. 1 out of 1 hunk FAILED -- rejects in file net/ipv4/netfilter/ipt_webmon.c
  55. The next patch would create the file net/ipv4/netfilter/webmon_deps/tree_map.h,
  56. which already exists!  Applying it anyway.
  57. patching file net/ipv4/netfilter/webmon_deps/tree_map.h
  58. Hunk #1 FAILED at 1.
  59. 1 out of 1 hunk FAILED -- rejects in file net/ipv4/netfilter/webmon_deps/tree_map.h
  60. The next patch would create the file net/ipv4/netfilter/ipt_timerange.c,
  61. which already exists!  Applying it anyway.
  62. patching file net/ipv4/netfilter/ipt_timerange.c
  63. Hunk #1 FAILED at 1.
  64. 1 out of 1 hunk FAILED -- rejects in file net/ipv4/netfilter/ipt_timerange.c
  65. The next patch would create the file net/ipv4/netfilter/ipt_timerange.mod.c,
  66. which already exists!  Applying it anyway.
  67. patching file net/ipv4/netfilter/ipt_timerange.mod.c
  68. Hunk #1 FAILED at 1.
  69. 1 out of 1 hunk FAILED -- rejects in file net/ipv4/netfilter/ipt_timerange.mod.c
  70. The next patch would create the file net/ipv4/netfilter/ipt_layer7.c,
  71. which already exists!  Applying it anyway.
  72. patching file net/ipv4/netfilter/ipt_layer7.c
  73. Hunk #1 FAILED at 1.
  74. 1 out of 1 hunk FAILED -- rejects in file net/ipv4/netfilter/ipt_layer7.c
  75. The next patch would create the file net/ipv4/netfilter/regexp/regexp.c,
  76. which already exists!  Applying it anyway.
  77. patching file net/ipv4/netfilter/regexp/regexp.c
  78. Hunk #1 FAILED at 1.
  79. 1 out of 1 hunk FAILED -- rejects in file net/ipv4/netfilter/regexp/regexp.c
  80. The next patch would create the file net/ipv4/netfilter/regexp/regexp.h,
  81. which already exists!  Applying it anyway.
  82. patching file net/ipv4/netfilter/regexp/regexp.h
  83. Hunk #1 FAILED at 1.
  84. 1 out of 1 hunk FAILED -- rejects in file net/ipv4/netfilter/regexp/regexp.h
  85. The next patch would create the file net/ipv4/netfilter/regexp/regmagic.h,
  86. which already exists!  Applying it anyway.
  87. patching file net/ipv4/netfilter/regexp/regmagic.h
  88. Hunk #1 FAILED at 1.
  89. 1 out of 1 hunk FAILED -- rejects in file net/ipv4/netfilter/regexp/regmagic.h
  90. The next patch would create the file net/ipv4/netfilter/regexp/regsub.c,
  91. which already exists!  Applying it anyway.
  92. patching file net/ipv4/netfilter/regexp/regsub.c
  93. Hunk #1 FAILED at 1.
  94. 1 out of 1 hunk FAILED -- rejects in file net/ipv4/netfilter/regexp/regsub.c
  95. The next patch would create the file net/ipv4/netfilter/bandwidth_deps/tree_map.h,
  96. which already exists!  Applying it anyway.
  97. patching file net/ipv4/netfilter/bandwidth_deps/tree_map.h
  98. Hunk #1 FAILED at 1.
  99. 1 out of 1 hunk FAILED -- rejects in file net/ipv4/netfilter/bandwidth_deps/tree_map.h
  100. The next patch would create the file net/ipv4/netfilter/ipt_bandwidth.c,
  101. which already exists!  Applying it anyway.
  102. patching file net/ipv4/netfilter/ipt_bandwidth.c
  103. Hunk #1 FAILED at 1.
  104. 1 out of 1 hunk FAILED -- rejects in file net/ipv4/netfilter/ipt_bandwidth.c
  105. The next patch would create the file net/ipv4/netfilter/ipt_bandwidth.mod.c,
  106. which already exists!  Applying it anyway.
  107. patching file net/ipv4/netfilter/ipt_bandwidth.mod.c
  108. Hunk #1 FAILED at 1.
  109. 1 out of 1 hunk FAILED -- rejects in file net/ipv4/netfilter/ipt_bandwidth.mod.c
  110. The next patch would create the file include/linux/netfilter_ipv4/ipt_weburl.h,
  111. which already exists!  Applying it anyway.
  112. patching file include/linux/netfilter_ipv4/ipt_weburl.h
  113. Hunk #1 FAILED at 1.
  114. 1 out of 1 hunk FAILED -- rejects in file include/linux/netfilter_ipv4/ipt_weburl.h
  115. The next patch would create the file include/linux/netfilter_ipv4/ipt_webmon.h,
  116. which already exists!  Applying it anyway.
  117. patching file include/linux/netfilter_ipv4/ipt_webmon.h
  118. Hunk #1 FAILED at 1.
  119. 1 out of 1 hunk FAILED -- rejects in file include/linux/netfilter_ipv4/ipt_webmon.h
  120. The next patch would create the file include/linux/netfilter_ipv4/ipt_timerange.h,
  121. which already exists!  Applying it anyway.
  122. patching file include/linux/netfilter_ipv4/ipt_timerange.h
  123. Hunk #1 FAILED at 1.
  124. 1 out of 1 hunk FAILED -- rejects in file include/linux/netfilter_ipv4/ipt_timerange.h
  125. The next patch would create the file include/linux/netfilter_ipv4/ipt_layer7.h,
  126. which already exists!  Applying it anyway.
  127. patching file include/linux/netfilter_ipv4/ipt_layer7.h
  128. Hunk #1 FAILED at 1.
  129. 1 out of 1 hunk FAILED -- rejects in file include/linux/netfilter_ipv4/ipt_layer7.h
  130. The next patch would create the file include/linux/netfilter_ipv4/ipt_bandwidth.h,
  131. which already exists!  Applying it anyway.
  132. patching file include/linux/netfilter_ipv4/ipt_bandwidth.h
  133. Hunk #1 FAILED at 1.
  134. 1 out of 1 hunk FAILED -- rejects in file include/linux/netfilter_ipv4/ipt_bandwidth.h
  135. Patch platform/650-custom_netfilter_match_modules.patch can be reverse-applied
  136. make[4]: *** [/home/fsyx/chaos_calmer/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-ar71xx_generic/linux-3.18.23/.quilt_checked] Error 1
  137. make[4]: Leaving directory `/home/fsyx/chaos_calmer/target/linux/ar71xx'
  138. make[3]: *** [compile] Error 2
  139. make[3]: Leaving directory `/home/fsyx/chaos_calmer/target/linux'
  140. make[2]: *** [target/linux/compile] Error 2
  141. make[2]: Leaving directory `/home/fsyx/chaos_calmer'
  142. make[1]: *** [/home/fsyx/chaos_calmer/staging_dir/target-mips_34kc_uClibc-0.9.33.2/stamp/.target_compile] Error 2
  143. make[1]: Leaving directory `/home/fsyx/chaos_calmer'
  144. make: *** [world] 错误 2
  145. [fsyx@localhost chaos_cal
复制代码

点评

跟我一样,我也是到了这步, 按照教程来了,又做了个新的环境,结果还是卡在这里。。 我用的是cc 15.05  详情 回复 发表于 2016-2-10 15:27
patch打不上,从头开始  详情 回复 发表于 2016-1-18 16:27
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-1-17 16:44 | 显示全部楼层
本帖最后由 乌卡卡 于 2016-1-17 23:30 编辑

这个真心好,献上完整补丁,暂无L7支持,等完美~

只能用在ar71xx,别的平台需要提取  target/linux/ar71xx/patches-3.18/650-custom_netfilter_match_modules.patch按照路径复制就可以了


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×

点评

这个path 怎么打? 放在相应的path-3.18目录下就行了吧。? 楼主步骤里的path还需要打吗?  详情 回复 发表于 2016-2-11 11:12
真给力。。。如果能有L7支持就更完美了。  详情 回复 发表于 2016-1-29 15:52
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-26 04:26

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表