找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 29500|回复: 64

X96MAX+刷openwrt写入EMMC并正确驱动千兆网卡教程

  [复制链接]
发表于 2021-2-28 01:57 | 显示全部楼层 |阅读模式
本帖最后由 foxpptma 于 2021-3-11 23:15 编辑

前段时间入手了X96MAX+,根据flippy大佬的固件给的方法刷入EMMC,网卡一直无法正确地驱动,经过自己的研究,现在X96MAX+可以正确地把OP写入EMMC并且能正常使用。
更新:此方法同样适用于TF卡/U盘启动,跳过最后的写入EMMC,重启就可以生效!
3月9日更新:
重要提醒!重要提醒!F大的54版本写入EMMC的时候,在选择是否将uboot写入EMMC的时候,这个选项一定要选择NO!一定要选择NO!,选择YES直接变砖,需要短接刷机!U盘/TF卡都启动不能!(刷入EMMC参照下面的,依旧能用,就是那个选项必须选择NO)



F大传送门:https://www.right.com.cn/forum/thread-4055451-1-1.html

特此在这里@flippy   大佬一下,希望他注意到这个问题

我主要是用到的上面这个贴里面的这个方法,但是一直失败,最后经过研究发现帖子里面的dd   if=/lib/u-boot/hk1box-bootloader.img  of=/dev/mmcblk2 bs=1M count=4  conv=fsync  # 这条命令hk1box-bootloader.img文件路径名不正确,导致一直未能替换成功,最后不能正常驱动网卡。期望F大大能及时修正。

接下来我把我的刷入方法教给大家:
准备工作:
下载F大的固件(论坛有)、SSH工具(Putty等都可以)、SFTP工具(winscp等)。个人推荐finalshell,整合了winscp+shh工具),下面的教程我也全程使用finallshell作为shh+SFTP工具。
1、下载F大佬的固件,用刷写工具写入U盘。我用的是balenaEtcher。这个可以按着大家的喜好来。
2、U盘插入盒子的USB口(任意一个都行)用细的东西顶住AV插孔里面的小复位键,插电开机,同时复位键不要松开。插电以后10S以后再松开复位键。
3、将盒子和电脑用网线相连接,电脑改成自动获取IP
4、查看电脑自动获取到192.168.1.X的IP地址以后,用SSH工具,进入192.168.1.1这个地址(如果没有获取到地址,请重播2操作)

5、我们进入boot文件夹,找到uEnv.txt,然后双击打开,把FDT=/dtb/amlogic/meson-sm1-x96-max-plus-100m.dtb这个前面打上#号,然后把 FDT=/dtb/amlogic/meson-sm1-x96-max-plus.dtbFDT=/dtb/amlogic/meson-sm1-x96-max-plus-oc.dtb前面的#去掉(普通/超频版自选),然后CTRL+S保存。(winscp建议winscp下载/boot/uEnv.txt,然后用notepad++修改,不要用记事本, 改完后再上传。)

6、SSH命令输入:dd  if=/dev/mmcblk2  of=/root/backup-bootloader.img   bs=1M   count=4   conv=fsync      (括号内的不复制,这条命令是备份原版的bootloader)
7、寻找HK1BOX的bootloader地址!这个因为固件不同,位置可能会不一致,不能直接用命令输入!一般位于如下图的位置,我们右击hk1box的bootloader,选择复制路径这个选项。

8、把这段命令的红色部分替换成我们刚才复制的路径:dd   if=/boot/lib/u-boot/hk1box-bootloader.img  of=/dev/mmcblk2 bs=1M count=4  conv=fsync    这段主要是替换成HK1的bootload。
原帖中F大的hk1box-bootloader.img文件路径名不正确,导致一直未能替换成功,最后不能正常驱动网卡,未什么要替换原因F大有说明。
出现如下图所示表示已经替换成功:

9、之后就是正常的写入emmc命令:
cd      /root
./install-to-emmc.sh

1、2的选择看你刚才在步骤5里面选择了什么,自选。

这4个随便选,看喜好。

之后poweroff命令关机,待完全关机以后拔U盘,再次插电开机,就能正常使用了,千兆网卡正常驱动。(不要在意系统语言)


本帖子中包含更多资源

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

×

评分

参与人数 1恩山币 +1 收起 理由
zhan*** + 1 感谢你的分享,无论怎样,你都是最无私的人!来,说说,你E盘上还有啥一起给我吧!

查看全部评分

我的恩山、我的无线 The best wifi forum is right here.
发表于 2021-2-28 03:58 | 显示全部楼层
谢谢分享宝贵经验~~~ 顺便问问:  超频版是  把 CPU 超频到 2208M ? 原来很慢的吗 ?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2021-2-28 13:32 | 显示全部楼层
楼主我是昨天群里找你的那位,
我今天有按照你的一模一样来了一遍

  1. root@OpenWrt:~# dd   if=/boot/lib/u-boot/hk1box-bootloader.img  of=/dev/mmcblk2 bs=1M count=4  conv=fsync
  2. 4+0 records in
  3. 4+0 records out
  4. root@OpenWrt:~# cd /root
  5. root@OpenWrt:~# ./install-to-emmc.sh
  6. /dev/mmcblk2
  7. mmcblk2 : 31268536320 bytes
  8. ROOTFS: sda2
  9. BOOT: sda1
  10. 接下来的步骤将会覆盖 EMMC 的原始数据, 请确认是否要继续!
  11. 选择 y 开始安装到 EMMC, 请择 n 则退出 y/n [y]

  12. -------------------
  13. 请选择盒子型号:
  14. 1. X96-Max+(S905x3) 注意:若选择本型号,将会刷入新的bootloader!
  15. 2. X96-Max+(S905x3) 超频版 注意:若选择本型号,将会刷入新的bootloader!

  16. 3. HK1 Box(S905x3)
  17. 4. HK1 Box(S905x3) 超频版

  18. 5. H96 Max X3(S905x3)
  19. 6. H96 Max X3(S905x3) 超频版

  20. 0. 其它
  21. -------------------
  22. 请选择: 1
  23. 备份原始 bootloader -> bootloader_backup.img ... 4+0 records in
  24. 4+0 records out
  25. 完成

  26. EMMC 上共有 0 个旧的分区会被删除

  27. Welcome to fdisk (util-linux 2.35.1).
  28. Changes will remain in memory only, until you decide to write them.
  29. Be careful before using the write command.

  30. Device does not contain a recognized partition table.
  31. Created a new DOS disklabel with disk identifier 0x2800dec2.

  32. Command (m for help): Partition type
  33.    p   primary (0 primary, 0 extended, 4 free)
  34.    e   extended (container for logical partitions)
  35. Select (default p): Partition number (1-4, default 1): First sector (2048-61071359, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (139264-61071359, default 61071359):
  36. Created a new partition 1 of type 'Linux' and of size 160 MiB.

  37. Command (m for help): Partition type
  38.    p   primary (1 primary, 0 extended, 3 free)
  39.    e   extended (container for logical partitions)
  40. Select (default p): Partition number (2-4, default 2): First sector (2048-61071359, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (466944-61071359, default 61071359):
  41. Created a new partition 2 of type 'Linux' and of size 960 MiB.

  42. Command (m for help): Partition type
  43.    p   primary (2 primary, 0 extended, 2 free)
  44.    e   extended (container for logical partitions)
  45. Select (default p): Partition number (3,4, default 3): First sector (2048-61071359, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (2764800-61071359, default 61071359):
  46. Created a new partition 3 of type 'Linux' and of size 960 MiB.

  47. Command (m for help): Partition type
  48.    p   primary (3 primary, 0 extended, 1 free)
  49.    e   extended (container for logical partitions)
  50. Select (default e):
  51. Selected partition 4
  52. First sector (2048-61071359, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (4730880-61071359, default 61071359):
  53. Created a new partition 4 of type 'Linux' and of size 26.9 GiB.

  54. Command (m for help): Partition number (1-4, default 4): Hex code (type L to list all codes):
  55. Changed type of partition 'Linux' to 'W95 FAT32 (LBA)'.

  56. Command (m for help): Partition number (1-4, default 4): Hex code (type L to list all codes):
  57. Changed type of partition 'Linux' to 'Linux'.

  58. Command (m for help): Partition number (1-4, default 4): Hex code (type L to list all codes):
  59. Changed type of partition 'Linux' to 'Linux'.

  60. Command (m for help): Partition number (1-4, default 4): Hex code (type L to list all codes):
  61. Changed type of partition 'Linux' to 'Linux'.

  62. Command (m for help): The partition table has been altered.
  63. Calling ioctl() to re-read partition table.
  64. Syncing disks.

  65. 分区完成

  66. 1+0 records in
  67. 1+0 records out
  68. 1+0 records in
  69. 1+0 records out
  70. 1+0 records in
  71. 1+0 records out
  72. 1+0 records in
  73. 1+0 records out
  74. 开始创建文件系统 ...
  75. 创建boot文件系统 ...
  76. mkfs.fat 4.1 (2017-01-24)
  77. 创建 rootfs1 文件系统 ...
  78. btrfs-progs v5.6
  79. See http://btrfs.wiki.kernel.org for more information.

  80. Label:              EMMC_ROOTFS1
  81. UUID:               ad8b9527-c80b-475c-a41b-b7e72ff23417
  82. Node size:          16384
  83. Sector size:        4096
  84. Filesystem size:    960.00MiB
  85. Block group profiles:
  86.   Data:             single            8.00MiB
  87.   Metadata:         single            8.00MiB
  88.   System:           single            4.00MiB
  89. SSD detected:       yes
  90. Incompat features:  extref, skinny-metadata
  91. Checksum:           crc32c
  92. Number of devices:  1
  93. Devices:
  94.    ID        SIZE  PATH
  95.     1   960.00MiB  /dev/mmcblk2p2

  96. 创建 rootfs2 文件系统 ...
  97. btrfs-progs v5.6
  98. See http://btrfs.wiki.kernel.org for more information.

  99. Label:              EMMC_ROOTFS2
  100. UUID:               97b037e3-4cce-437f-ad0d-93f1128274e7
  101. Node size:          16384
  102. Sector size:        4096
  103. Filesystem size:    960.00MiB
  104. Block group profiles:
  105.   Data:             single            8.00MiB
  106.   Metadata:         single            8.00MiB
  107.   System:           single            4.00MiB
  108. SSD detected:       yes
  109. Incompat features:  extref, skinny-metadata
  110. Checksum:           crc32c
  111. Number of devices:  1
  112. Devices:
  113.    ID        SIZE  PATH
  114.     1   960.00MiB  /dev/mmcblk2p3

  115. 等待 boot 文件系统挂载 ...
  116. 挂载成功
  117. 拷贝 boot ...done
  118. Write uEnv.txt ... 完成.
  119. 完成

  120. 等待 rootfs 文件系统挂载 ...
  121. 挂载成功
  122. 创建文件夹 ... 完成
  123. 拷贝数据 ...
  124. 拷贝 root ... 完成
  125. 拷贝 etc ... 完成
  126. 拷贝 bin ... 完成
  127. 拷贝 sbin ... 完成
  128. 拷贝 lib ... 完成
  129. 拷贝 opt ... 完成
  130. 拷贝 usr ... 完成
  131. 拷贝 www ... 完成
  132. 拷贝完成
  133. 编辑配置文件 ... 完成

  134. 创建共享文件系统 ...
  135. 请选择共享文件系统的类型:
  136. ------------------------------------------
  137. 1. ext4 (默认的选项,适合一般用途)

  138. 2. btrfs (对 ssd/mmc 有一定优化,
  139.           可延长 ssd/mmc 使用寿命,
  140.           具有众多现代文件系统特性,
  141.           但速度稍慢)

  142. 3. f2fs  (对 ssd/mmc 有专门的优化,
  143.           读写速度快,
  144.           且可延长 ssd/mmc 使用寿命,
  145.           但空间利用率稍低,
  146.           且兼容性稍差)

  147. 4. xfs   (非常优秀的文件系统,ext4的替代品)
  148. ------------------------------------------
  149. [1]
  150. mke2fs 1.45.6 (20-Mar-2020)
  151. Creating filesystem with 7042560 4k blocks and 1761280 inodes
  152. Filesystem UUID: 96b12160-cb25-4734-a34b-9066435d38b5
  153. Superblock backups stored on blocks:
  154.         32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
  155.         4096000

  156. Allocating group tables: done
  157. Writing inode tables: done
  158. Creating journal (32768 blocks): done
  159. Writing superblocks and filesystem accounting information: done

  160. 完成

  161. 注意:原版 bootloader 已导出到 /root/backup-bootloader.img , 请注意下载并保存!
  162. 所有步骤均已完成, 请用 poweroff 命令关机,拔除SD卡(或U盘)之后再开机!
  163. root@OpenWrt:~#
  164. root@OpenWrt:~#
  165. root@OpenWrt:~#
  166. root@OpenWrt:~# poweroff
  167. root@OpenWrt:~#
  168. Remote side unexpectedly closed network connection
复制代码



结果还是黑屏...无法亮机.

点评

一样的情况 后来有解决了吗?  详情 回复 发表于 2021-4-18 02:06
uEnv.txt 这个改了没?  详情 回复 发表于 2021-2-28 16:38
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2021-2-28 16:38 | 显示全部楼层
jsonsong 发表于 2021-2-28 13:32
楼主我是昨天群里找你的那位,
我今天有按照你的一模一样来了一遍

uEnv.txt 这个改了没?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2021-2-28 20:37 | 显示全部楼层
感谢指出错误,确实是代码里有BUG,下个版本还是恢复到  /lib/u-boot/这个路径。

点评

armbian包里完全没有这个,从其他包里拿过来刷进去直接变砖了  详情 回复 发表于 2021-4-6 11:08
我也是翻车了好几次,才发现的  详情 回复 发表于 2021-2-28 22:33
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2021-2-28 22:33 | 显示全部楼层
flippy 发表于 2021-2-28 20:37
感谢指出错误,确实是代码里有BUG,下个版本还是恢复到  /lib/u-boot/这个路径。

我也是翻车了好几次,才发现的
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2021-3-3 17:43 | 显示全部楼层
遇到难题了,插入U盘之后,自动获取的IP是169.254.195.x,手动设置192.168.1.X也ping不通,请问纠结是哪里出的问题

点评

是网卡没有正确驱动吧  详情 回复 发表于 2021-3-3 20:10
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2021-3-3 20:10 | 显示全部楼层
比尔盖茨 发表于 2021-3-3 17:43
遇到难题了,插入U盘之后,自动获取的IP是169.254.195.x,手动设置192.168.1.X也ping不通,请问纠结是哪里 ...

是网卡没有正确驱动吧

点评

我怀疑是, 【但是一直失败,最后经过研究发现帖子里面的dd if=/lib/u-boot/hk1box-bootloader.img of=/dev/mmcblk2 bs=1M count=4 conv=fsync # 这条命令hk1box-bootloader.img文件路径名不正确,导致一直未  详情 回复 发表于 2021-3-3 20:59
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2021-3-3 20:59 | 显示全部楼层
foxpptma 发表于 2021-3-3 20:10
是网卡没有正确驱动吧

我怀疑是,
【但是一直失败,最后经过研究发现帖子里面的dd   if=/lib/u-boot/hk1box-bootloader.img  of=/dev/mmcblk2 bs=1M count=4  conv=fsync  # 这条命令hk1box-bootloader.img文件路径名不正确,导致一直未能替换成功,最后不能正常驱动网卡。】

这个请问是在哪一步操作的?好像是能连上SSH吧,现在我ping不通
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2021-3-3 23:01 | 显示全部楼层
退坑了,F大刚指出有概率的 启动不起 要改硬件,小白动手能力不强,加上还要额外买电源(原厂的不好),还要散热改造,弄下来的成本和精力还不如直接搞树莓派
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2021-3-4 17:28 | 显示全部楼层
终于知道什么原因了,看了B站的UP主,要先改BOOT 里面的东西,而X96的不要改,按照默认的百兆口启动,才能ping通192.168.1.1,然后接着才修改千兆的DTB
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2021-3-4 20:31 | 显示全部楼层
我刚好想买这个盒子,然后研究怎么让它跑千兆
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2021-3-9 22:33 | 显示全部楼层
刷成功了,但是无线驱动不起来,大佬们怎么解决的,这里请教了

点评

我也是同样问题,大佬找到解决方法了吗?  详情 回复 发表于 2021-7-28 21:23
无线我至今没有找到好的解决方式  详情 回复 发表于 2021-3-10 20:01
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2021-3-10 09:04 | 显示全部楼层
这东西温度怎么样

点评

买个散热片 自己贴就好了。不过做软路由这个温度也不会很高。  详情 回复 发表于 2021-3-10 20:02
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2021-3-10 20:01 | 显示全部楼层
wchfcoll 发表于 2021-3-9 22:33
刷成功了,但是无线驱动不起来,大佬们怎么解决的,这里请教了

无线我至今没有找到好的解决方式

点评

armbian自带无线驱动,自带网口却驱动不了[attachimg]459523[/attachimg]  详情 回复 发表于 2021-3-21 10:26
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-26 06:20

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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

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