找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
楼主: ach***

唤醒华为智能网关光猫隐藏的小宇宙:OpenWRT

 火.. [复制链接]
发表于 2020-1-8 16:48 来自手机 | 显示全部楼层
这个帖子从头看到尾,受益良多
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-1-10 00:10 | 显示全部楼层
8145c5可以吗
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-1-14 03:31 | 显示全部楼层

楼主,安装完luci-base,luci-mod-admin-full浏览器出BadGateway

本帖最后由 没尾巴的牛 于 2020-1-16 03:13 编辑

楼主,麻烦看下
安装完opkg install luci-base,opkg install luci-mod-admin-full,打不开openwrt的web界面怎么解?现在提示BadGateway
开始安装的时候,老是报错,类似下面这样,像是依赖库没有
  1. root@SAF:/etc# opkg install luci-mod-admin-full
  2. Installing luci-mod-admin-full (git-16.018.33482-3201903-1) to root...
  3. Downloading http://archive.openwrt.org/chaos_calmer/15.05.1/omap/generic/packages/luci/luci-mod-admin-full_git-16.018.33482-3201903-1_omap.ipk.
  4. Collected errors:
  5. * satisfy_dependencies_for: Cannot satisfy the following dependencies for luci-mod-admin-full:
  6. *         libc *         libc *         libc *         libc *         libc *         libc *         libc *         libc *         libc *         libc *         libc *         libc *         libc *         libc *         libc *
  7. * opkg_install_cmd: Cannot install package luci-mod-admin-full.
复制代码
然后我上网找,找到解决办法,首先,下载libc,安装,安装的过程中,又自动安装了另一个不知道干什么的依赖包。。。
如下
  1. root@SAF:~# wget https://archive.openwrt.org/chaos_calmer/15.05.1/omap/generic/packages/base/libc_0.9.33.2-
  2. 1_omap.ipk
  3. Connecting to archive.openwrt.org (81.0.124.218:443)
  4. libc_0.9.33.2-1_omap 100% |**********************************************************|   191k  0:00:00 ETA
  5. root@SAF:~# opkg install libc_0.9.33.2-1_omap.ipk
  6. Installing libc (0.9.33.2-1) to root...
  7. Installing libgcc (4.8-linaro-1) to root...
  8. Downloading http://archive.openwrt.org/chaos_calmer/15.05.1/omap/generic/packages/base/libgcc_4.8-linaro-1_omap.ipk.
  9. Configuring libgcc.
  10. Configuring libc.
复制代码
库装上了,然后我迫不及待的安装了luci-mod-admin-full,安装过程中下载了好多依赖,包括luci-base。
  1. root@SAF:~# opkg install luci-mod-admin-full
  2. Installing luci-mod-admin-full (git-16.018.33482-3201903-1) to root...
  3. Downloading http://archive.openwrt.org/chaos_calmer/15.05.1/omap/generic/packages/luci/luci-mod-admin-full_git-16.018.33482-3201903-1_omap.ipk.
  4. Installing luci-base (git-16.018.33482-3201903-1) to root...
  5. Downloading http://archive.openwrt.org/chaos_calmer/15.05.1/omap/generic/packages/luci/luci-base_git-16.018.33482-3201903-1_omap.ipk.
  6. 略过N行
  7. Configuring libubox.
  8. Configuring libuci.
  9. Configuring liblua.
  10. Configuring libuci-lua.
  11. Configuring libubus.
  12. Configuring libjson-c.
  13. Configuring libblobmsg-json.
  14. Configuring rpcd.
  15. Failed to connect to ubus
  16. Configuring libnl-tiny.
  17. Configuring luci-lib-ip.
  18. Configuring libubus-lua.
  19. Configuring lua.
  20. Configuring luci-lib-nixio.
  21. Configuring luci-base.
  22. Configuring luci-mod-admin-full.
复制代码
然后我马上打开浏览器
http://192.168.1.1:80
BadGateway
The process did not produce any response
我猜测是uhttpd,没启动。
  1. root@SAF:~# /etc/init.d/uhttpd start
  2. Failed to connect to ubus
复制代码
不管用,赶紧试试华为系统有没有崩,
http://192.168.1.1:8080,顺利打开,安心了,这个没问题。
然后各种网上找,找了个命令,据说十分灵
  1. rm -r /tmp/luci-indexcache
复制代码
说是清理缓存的,弄完,还不如从前。/哭
现在http://192.168.1.1:80是
NotFound
File not found.
现在我又重装了,不敢执行那个清缓存命令。



------------------------------------------------------------------以下是傻傻的经验教训,重装ssh,可以略过-----------------------------------------------------------
输完那个命令,op系统的ssh上不去了。
登陆的时候老是提示,需要密钥文件,而且不支持用户名密码登录,网上找了一圈,没找到怎么弄,
估计是op的ssh掉了,需要重装,并配置。

想根据楼主的教程重走一遍

卡在了解包这一步。(我今天看,可能不需要这一步,因为文件都在,可能只需要配置下)
  1. WAP(Dopra Linux) #tar xzf /tmp/data.tar.gz
  2. tar: can't createdirectory './usr': File exists
  3. tar: can't make dir./usr/lib: Not a directory
  4. tar: can't createdirectory './usr/': Not a directory
  5. tar: can't createdirectory './usr/': Not a directory
  6. tar: can't createdirectory './usr': File exists
  7. tar: can't make dir./usr/bin: Not a directory
  8. tar: can't createdirectory './usr/': Not a directory
  9. tar: can't remove oldfile ./usr/: Not a directory
  10. WAP(Dopra Linux) #tar: write: Broken pipe
复制代码

我尝试了好几种方法,都不行。放弃,把光猫恢复出厂,重头在再来一遍
第一步,开启进猫的安全界面开启telnet


第二步用shell工具,不用也行,直接cmd
telnet 192.168.1.1

第三步,看shell是否是全的
我这个是全的

第4步
按照楼主教程走一遍
看看不会卡住吧。。。
结果第一步就报错了
  1. WAP(Dopra Linux) # cd/tmp && rm hw_ctree*
  2. rm: can't remove'hw_ctree*': No such file or directory
复制代码

我有不详的预感,还得卡在相同的位置(其实rm hw_ctree*是为了删掉以前编辑的配置文件,防止搞混

太好了,没卡在解包那一步

但是下面这一步报错了,提示文件夹已存在
  1. WAP(Dopra Linux) #mkdir etc/rc.d && cd etc/rc.d
  2. mkdir: can't createdirectory 'etc/rc.d': File exists
复制代码

然后下面这一步报错,提示无此文件或目录。
  1. WAP(Dopra Linux) #sed -i "s/root:/root:$rootpw/" ../shadow
  2. /bin/sh: sed: notfound
  3. WAP(Dopra Linux) #sed -i "s/root:/root:$rootpw/" ../shadow
  4. sed: ../shadow: Nosuch file or directory
复制代码

因为上面的
  1. mkdir etc/rc.d && cd etc/rc.d
复制代码

前半部分mkdir etc/rc.d没有执行成功,所以,后面的cdetc/rc.d就不会执行,所以,后面的
  1. ln -s ../init.d/dropbear S50dropbear
复制代码
生成软连接可定就在/opt/upt/apps/apps/目录下了,刚才cd /opt/upt/apps/apps/过去,ls,果然在这里,然后rm S50dropbear,删除了S50dropbear这个软链接。
然后手动cd /etc/rc.d(这是最大的错误)
  1. WAP(Dopra Linux) #cd /opt/upt/apps/apps/
  2. WAP(Dopra Linux) #ls
  3. S50dropbear etc          opt         uds          usr          var
  4. WAP(Dopra Linux) #rm S50dropbear
  5. WAP(Dopra Linux) #ls
  6. etc  opt uds  usr  var
  7. WAP(Dopra Linux) #cd /etc/rc.d
  8. WAP(Dopra Linux) #ls
  9. init.d      rc.shutdown  rc.start     rc.stop     rc.sysinit   rc.ttyini
复制代码

随着我对linux各个指令的熟悉,刚才有些地方不懂的,现在一点一点懂了。(我的自以为是害死我了,/汗

继续,接着就报错了。。系统文件只读。。。
  1. WAP(Dopra Linux) ln -s ../init.d/dropbear S50dropbear
  2. ln: S50dropbear: Read-only file system
  3. WAP(Dopra Linux)cd /etc/rc.d
  4. WAP(Dopra Linux)# ls
  5. init.d      rc.shutdown  rc.start     rc.stop     rc.sysinit   rc.ttyinit
  6. WAP(Dopra Linux)# ln -s /opt/upt/apps/apps/etc/init.d/dropbear S50dropbear
  7. ln: S50dropbear:Read-only file system
复制代码


还是报错
提示只读,看来我需要把这个文件夹改下权限(回过头看,当时是钻牛角尖了。
drwxr-xr-x    5 root     root          115 Nov 16  2017 rc.d
  1. WAP(Dopra Linux) # chmod -R 777 /etc/rc.d
  2. chmod: /etc/rc.d: Read-only file system
  3. chmod: /etc/rc.d: Read-only file system
复制代码

奇怪,还不能改权限。

在网上找了一条指令
  1. mount -o remount -rw  /
复制代码
不顶事

再来
  1. cp -d /opt/upt/apps/apps/etc/init.d/S50dropbear /etc/rc.d/
复制代码

-d的意思是,如果源文件是软链接,那么复制过去还是软链接
还是不行。服了。。

网上又找:
  1. mount -o remount,rw /
复制代码
还是不行

以下是我的分区
  1. WAP(Dopra Linux) # vi /etc/fstab
  2. proc                   /proc           proc    defaults               0 0
  3. sysfs                  /sys            sysfs  defaults                0 0
  4. tmpfs           /dev       tmpfs       defaults               0 0
  5. devpts                 /dev/pts        devpts  mode=620               0 0
  6. tmpfs           /dev/shm       tmpfs   nodev,size=512m              0 0
  7. tmpfs           /tmp           tmpfs   nodev,size=512m              0 0
复制代码

重启,没用
明天再说,这一步卡死了。
直接下一步试试
  1. sed -i"s/root:/root:$rootpw/" /opt/upt/apps/apps/etc/shadow
复制代码

明天再来
刷机也失败

经历了两天,重新回到起点,我找来我的另一台新猫。重新梳理,重新配置,找到了原因
知道为什么报错,只读了,因为
这条命令的误解
  1. cd /opt/upt/apps/apps/
  2. tar xzf /tmp/data.tar.gz
  3. mkdir etc/rc.d && cd etc/rc.d
复制代码

其中,这里的cd etc/rc.d
这个etc前面没“/”
绝对路径命令是,cd /opt/upt/apps/apps/etc/rc.d,而不是/etc/rc.d

就因为这一句的误解,前天晚上,昨天晚上白搭2个晚上,还把猫差点搞砖。
现在这个猫还有点问题,因为固件恢复,是用其他猫,所以,什么标识,wifi,都是那个猫的名字。
------------------------------------------------------------------以上是傻傻的经验教训,重装ssh-----------------------------------------------------------




本帖子中包含更多资源

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

×
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-1-14 03:54 | 显示全部楼层
感谢大佬  很详细
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-1-16 03:35 | 显示全部楼层
本帖最后由 没尾巴的牛 于 2020-1-18 00:32 编辑
aini50563 发表于 2019-2-13 20:51
再次更新语言包,看着就大有可玩的了,只是可惜,网络接口配置没有配套接口,跳转不了,
第三阶段,择日再 ...

大神,能整理一篇教程吗,尝试了一次,失败,不敢在尝试了。

看了您所有的回复,就是安装luci-base和luci-mod-admin-full后报错,然后你又安装了luci-theme-bootstrap
就好了?


又重头装了一遍luci-mod-admin-full这次跟我上面那个一样,中间有个Failed to connect to ubus

打开网页还是
Bad GatewayThe process did not produce any response


uhttpd无法启动

提示
  1. root@SAF:~# /etc/init.d/uhttpd restart
  2. Failed to connect to ubus
  3. Failed to connect to ubus
复制代码




查询ubus,开启来没什么问题
  1. root@SAF:/etc/init.d# ps | grep ubusd
  2.    24 root       904 S    /sbin/ubusd
  3. 1344 root      1132 S    grep ubusd
复制代码



杀掉ubusd 在重启
  1. root@SAF:/var# killall -9 ubusd ; /sbin/ubusd &
  2. root@SAF:/var# ps | grep ubusd
  3. 1348 root       948 S    /sbin/ubusd
  4. 1349 root       948 S    /sbin/ubusd
  5. 1351 root      1132 S    grep ubusd
复制代码




多了个ubusd。不懂

vi /etc/config/uhttpd

这个看起来也没问题啊。或者我不会看?还是光猫原始的那个。
vi /etc/init.d/uhttpd

这个也看不懂。



然后究极一点,我直接把www下面的index.htm编辑了下
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>hello word</title>
  6. </head>
  7. <body>
  8. hello word
  9. </body>
  10. </html>
复制代码




事实证明这个uhttpd已经生效了,可以正确显示这个网页
hello word


这个是原来的网页源码
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Cache-Control" content="no-cache" />
  6. <meta http-equiv="refresh" content="0; URL=/cgi-bin/luci" />
  7. </head>
  8. <body style="background-color: white">
  9. <a style="color: black; font-family: arial, helvetica, sans-serif;" href="/cgi-bin/luci">LuCI - Lua Configuration Interface</a>
  10. </body>
  11. </html>
复制代码


很显然他指向了/cgi-bin/luci
而这个luci的内容是
  1. #!/usr/bin/lua
  2. require "luci.cacheloader"
  3. require "luci.sgi.cgi"
  4. luci.dispatcher.indexcache = "/tmp/luci-indexcache"
  5. luci.sgi.cgi.run()
复制代码



不太懂啊








我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-2-9 18:52 | 显示全部楼层
能够telnet到openwrt  安装luci无法登录  最后没办法删除所有乱七八糟的  刷了2遍机,替换jffs2才恢复原始状态  建议小白不要胡乱搞了,坐等出最全面的教程再说
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-2-10 19:59 | 显示全部楼层
牛神仙的探索和无私的分享
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-3-11 22:53 | 显示全部楼层
好奇下家里的光猫虽然不是HW,不过也是贴牌的吉比特GS3202,有空也想搞下哈~~ROM真大。。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-3-12 09:06 | 显示全部楼层

谢谢分享,学习一下
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-3-16 23:22 | 显示全部楼层
谢谢分享,接了硬盘 安装了 aria2 ,能启动,一下载就FC了,求解。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-3-16 23:33 | 显示全部楼层
华为原厂的luci,谁能打包一个发上来吗?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-3-17 08:50 | 显示全部楼层
不知道怎么打包。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-4-22 21:59 | 显示全部楼层
感谢楼主的文章!!!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-10-26 19:06 | 显示全部楼层
谢谢了,学习学习!!!!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2021-2-2 19:46 | 显示全部楼层
谢谢了,HS8145V成功开启openwrt
按照楼主的来后遇到了2个问题
一个是步骤1.3后ssh还是无法访问,通过进telnet开放22端口解决
另外一个是openwrt的web界面打不开,更新opkg源后安装luci-base和luci-mod-admin-full后还得再到telnet里开放80端口
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-25 21:59

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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

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