本帖最后由 tm5880891 于 2020-3-25 02:33 编辑 ' v4 f9 P* n9 ]& i6 q& e% A/ h
& P4 i, w* H, D+ _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"
. a" R7 x0 ]- v4 O3 [
这就是所有的分区内容了
1 W: n: r1 Z. t3 x; h5 L1 y+ _
要求:需要使用 dd 命令依次取出这些分区里的内容
* e$ W; M. U! f; L' l: l/ ] Y
2.因中兴光猫自带的busybox 没有 dd 命令,因此需要导入一个带有dd命令的busybox ) |& C% M9 A' D: T" }
导入前要先查看光猫 CPU 信息,方便导入对应的busybox + v/ U) l7 x, q; t5 g. M) H6 |) Z) G
/ # 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 9 X/ A3 `+ L: a. M$ ^% `
Hardware : HGU R evision : 0000 Serial : 0000000000000000 / #
, Y8 f6 W+ ]! E/ d/ c注意到 Processor 为 ARMv7 Processor rev 1 (v7l) 2 |+ u+ d6 D' b5 r# @
因此得导入arm v7l 版本的 busybox
9 c3 U7 U+ N8 }# u
在所在文件的目录下开启tftpd软件 cd /tmp tftp -g -r busybox-armv7l -l busybox-armv7l 192.168.1.2 chmod +x busybox-armv7l mv busybox-armv7l busybox
" X3 B8 [7 |$ U
3.开始拷贝文件
8 u& g" Q/ n+ p' p
cd /tmp
# H& W' |0 [8 Z2 x/ y7 [ dd if=/dev/mtd1 of=/tmp/u-boot.bin # 打包分区 tftp -l u-boot.bin -p 192.168.1.2 # 上传打包的分区到本地 tftp 服务器 ! F) v6 t X: @) W6 n
至此,按各分区大小和所在目录分别传输完毕...
/ |6 e8 D! S( d" B+ R( ]* ]1 b( {6 e& S: {- v) `* `
4 M2 F, I# \$ \2 e. V C/ B2 V4 |* a7 `
% Q. L8 e# d2 F2 s5 t0 S4 I |