本帖最后由 tm5880891 于 2020-3-25 02:33 编辑
1.通过/proc虚拟文件系统读取MTD分区表: / # cat/proc/mtd dev: size erasesize name mtd0: 0800000000020000 "whole flash" mtd1: 0020000000020000 "u-boot" mtd2: 0040000000020000 "parameter tags" mtd3: 0140000000020000 "kernel0" mtd4: 0040000000020000 "middleware" mtd5: 0080000000020000 "usercfg" mtd6: 0140000000020000 "kernel1" mtd7: 0060000000020000 "others" mtd8: 0040000000020000 "wlan"
这就是所有的分区内容了
要求:需要使用 dd 命令依次取出这些分区里的内容
2.因中兴光猫自带的busybox 没有 dd 命令,因此需要导入一个带有dd命令的busybox
导入前要先查看光猫 CPU 信息,方便导入对应的busybox
/ # cat/proc/cpuinfo Processor : ARMv7 Processor rev 1 (v7l) BogoMIPS : 1599.07 Features : swp half fastmult edsp CPU implementer: 0x41 CPUarchitecture: 7 CPUvariant : 0x4 CPU part : 0xc09 CPUrevision : 1
Hardware : HGU R evision : 0000 Serial : 0000000000000000 / #
注意到 Processor 为 ARMv7 Processor rev 1 (v7l)
因此得导入arm v7l 版本的 busybox
在所在文件的目录下开启tftpd软件 cd /tmp tftp -g -r busybox-armv7l -l busybox-armv7l 192.168.1.2 chmod +x busybox-armv7l mv busybox-armv7l busybox
3.开始拷贝文件
cd /tmp
dd if=/dev/mtd1 of=/tmp/u-boot.bin # 打包分区 tftp -l u-boot.bin -p 192.168.1.2 # 上传打包的分区到本地 tftp 服务器
至此,按各分区大小和所在目录分别传输完毕...
|