找回密码
 注册

QQ登录

只需一步,快速开始

查看: 2401|回复: 5

大容量Nand Flash 光猫固件备份方法

[复制链接]
发表于 2024-1-4 00:51:51 | 显示全部楼层 |阅读模式
本帖最后由 jiuweiljp 于 2024-1-4 01:05 编辑
3 r0 F$ n% f( b; V6 h9 k7 S9 Y2 r! H% J( d4 Y
使用条件:
) T4 D4 \4 Y4 t2 s     1、有usb接口并且能驱动U pan的无视这个方法;
% h3 c" [+ t9 S3 ?7 w9 h( Z+ F+ `     2、光猫不能telnet,并没有tftp或者wget、chmod命令也可以不用看;3 n/ l! V% R# ^; ^: R. s& r
5 j3 @& D4 M) q5 z! G
正文如下( |2 E5 z8 r# b3 p/ [
手上有一个闲置的中兴光猫F657GV9,焊接TTL线后启动信息如下(可无视):
% e, K* Z# d3 D5 b) P( n5 P
  1. U-Boot 2013.04 (Sep 11 2021 - 00:00:57)
    ; V9 o( [. V3 }
  2. % p$ O  J# c4 k/ {9 @; A' M$ c
  3. CPU  : ZX279127S@A9,1000MHZ. W8 _3 }) h0 m* n, m! Q4 C4 {4 P+ d
  4. Board: ZXIC zx279127sevb
      f) \9 J7 b% e$ A' E" M4 j) F
  5. 127s product_vid = 158' E  c& s! M0 L$ I
  6. DRAM:  256 MiB
    / W* |2 z& R1 v+ {
  7. 127s product_vid = 158
    $ g' r3 Q* A, `
  8. ,10000000,50000000
    ; [% E( v3 d# W8 j4 p# C
  9. cpuid=279127104 O7 ^8 O' U# T  n/ n% e
  10. 127s pinmux: 3f7ffffa  3ffffeff  19ff0555  6be1b
    & T( w9 i4 }* w6 V; h
  11. 127s product_vid = 158% H: E6 M/ F( U) r5 h" v8 X
  12. bootsel=35 W+ |3 X% D7 z
  13. NAND:  . Q' ^* t) ?+ _
  14. Manu ID: 0x2c, Chip ID: 0x24 (Micron SPI NAND MT29F2G01ABAGDWB  256MiB 3,3V)
    ( ~6 d- z- z3 N9 J7 {+ [( d) b
  15. 256 MiB- ~) U" a6 e0 A
  16. <nand_read_skip_bad_,447>!mtdpart=0x1,offset=0x0,mtdpartoffset=0x180000,mtdPartsize=0x80000,length=0x200009 ]7 z9 c$ q& O# s  L
  17. In:    serial
    , U: I+ @, C" ^
  18. Out:   serial6 S3 X& o" _* i5 G# C" U
  19. Err:   serial
    * {9 O8 O  }# |: k) ~* ?  x
  20. clk_pll env is not setted, core clk won't change, ^8 U6 o$ |& C
  21. Net:   enter ref_clk_set.. mode = 0 .. R  G# \7 T$ T; E& H! [
  22. enter pll_cfg_fractional. q5 R( u4 G7 i8 b8 D4 p
  23. ref_clk_set success!& [9 i; l( q. t6 [& u2 Z
  24. gpon serdes init - Q: C- G" }' Y5 U6 t
  25. addr 0x9400002c before value is 11000013& @, a! F( Q5 C9 N
  26. addr 0x9400004c after value is 11003ff3
    . {1 {; a. D! @' A$ d1 g" N
  27. eth00 r- x0 z/ a& p0 ?" t# W. J% W. ^
  28. sec mode!  }/ z, T+ |" I9 I

  29. ' @) O8 D, {: M' z# f- r' x
  30. Hit 1 to upgrade software version
    2 N+ ?$ L* }, B5 v% c7 Q% \. }
  31. Hit any key to stop autoboot:  0
    ; u7 ~& f  w1 v4 B/ R$ ~3 D
  32. addr=1200000
    7 x) E/ U  p0 I5 M: S7 u* o3 p# C
  33. addr=4200000
    . L& V' i, A+ S5 W2 B3 {+ P
  34. select=0x0
    ) d& a/ ^3 t- i2 [0 s! Y
  35. search=0x2
    1 O1 g" z" q& E1 I1 Y
  36. <nand_read_skip_bad_,447>!mtdpart=0x6,offset=0x0,mtdpartoffset=0x200000,mtdPartsize=0x200000,length=0x10006 K" S% d! Z# h6 ^( |+ v' U% j
  37. tmp=0x00000000, value=0
    8 s" [4 @, g$ n+ K
  38. select=0x0
    . }6 p4 G7 L0 X' T& ~6 N
  39. search=0x20 f4 o  r% Z/ I2 i& h
  40. search->result[0].entry=12002404 {9 f) n; v: V/ `4 j
  41. <nand_read_skip_bad_,447>!mtdpart=0x2,offset=0x0,mtdpartoffset=0x1200000,mtdPartsize=0x3000000,length=0x23e0000
    - f' R) H% f" l  b& M2 g" A1 \8 |' J
  42. RSA Verify OK4 O5 ]& Z3 h3 @7 O4 @: U

  43. " X  J9 R- M3 f1 H  X( J% b- M: |; p
  44. ---mtdparts_init--current_mtd_partnum=0-: h: t  y4 D8 L
  45. dev id: type = 2, num = 0, size = 0xffffffff, mtd_id = single part6 w, o, Q) o6 @, X4 e
  46. part  : name = rootfs0, size = 0x023c0000, offset = 0x01220000
    9 ~' G0 a1 t9 {& e+ G( H
  47. part  : name = rootfs1, size = 0x023c0000, offset = 0x04220000* n! i& J( X8 k: C& X  M
  48. 5 i/ P5 t( n8 N: @1 Q
  49. --- jffs2_part_info: partition number 0 for device nand0 (single part)
    3 S$ u: |, {) B! Q
  50. jffs2_part_info:rootfs0,1220000. D5 ]5 ]9 Q; L9 ~. A! g
  51. ### JFFS2 loading '0uImage' to 0x44000000
    + |# n- G# h' N( P: I, x
  52. Scanning JFFS2 FS: ..................... done.
    % a9 V* ?% V) r- [3 @
  53. ### JFFS2 load complete: 4344391 bytes loaded to 0x44000000
    * ]5 k" n, \) D7 L; `' z1 y
  54. 127s product_vid = 158
    # z- E2 C# E. V- w( ]
  55. <nand_read_skip_bad_,447>!mtdpart=0x0,offset=0x0,mtdpartoffset=0x0,mtdPartsize=0x180000,length=0x100000
    $ V6 I2 \* m  @
  56. lseek=0x42080800
    # F; l, S" K. r7 q) i4 x
  57. cmdline=U-Boot V1.0.0P1N1 20210911001937
    ( j* q; S$ S( b- B' C
  58. output gpio:58, value=1, 0( O( U% J$ g3 e) j% g2 U1 J7 X
  59. output gpio:59, value=1, 0
    : `0 {& Z# _+ h  n4 D2 ?8 o
  60. ## Booting kernel from Legacy Image at 44000000 ...
    2 J% R. G1 I1 O) I
  61.    Image Name:   Linux Kernel Image- P; v) d: U' b& ^3 L3 ]8 |
  62.    Image Type:   ARM Linux Kernel Image (uncompressed)
    ; u5 E2 J& s" \% f" e  S
  63.    Data Size:    4344327 Bytes = 4.1 MiB! X8 L! x# D% h1 \  i) D" r% ]2 k1 E! A
  64.    Load Address: 40008000/ x; f6 N  n' ^( P' E/ Y
  65.    Entry Point:  400080004 @7 g& z' w: ]5 F% E
  66.    Verifying Checksum ... OK! U/ _' L0 s0 C# r# {+ V' f' H. R
  67.    Loading Kernel Image ... OK
    3 S" v- i+ z5 z$ E1 m
  68. OK/ Q" Z- W% @( R  x
  69. ----------------------6 @* ^. I, \& Q" A
  70. |-->setup versioninfo tag...
    6 m9 y3 o% ?* y+ j* {
  71. * y' q8 o: K% ~; w
  72. Starting kernel ...
复制代码
根据启动信息可以得知
* y7 `/ N6 @2 t" zcpu(ZX279127S@A9,1000MHZ)后面再吐槽它,内存(DRAM: 256 MiB),闪存用的美光(Micron SPI NAND MT29F2G01ABAGDWB 256MiB 3,3V其实这个光猫也有USB接口,我测量过没有5V输出,如果想USB好用需要补元件。
+ p% _6 J( Q& u' W4 D; v0 @, d6 V' z& ^# l, ^* t; N) e
使用工具软件打开光猫telnet并登录后查看mtd信息; d0 k: ?! Y3 S5 Q- S4 `* e: o3 ^% O6 @' _' _
  1. / # cat /proc/mtd
    # ~- G& v! Y3 `& y8 E
  2. dev:    size   erasesize  name
    ; `) {5 \: S* W5 d
  3. mtd0: 10000000 00020000 "whole flash"
    + Y3 d6 L5 G: ?/ j
  4. mtd1: 00200000 00020000 "u-boot"
    - \$ b6 L" x3 g' Q$ f1 e; v
  5. mtd2: 00200000 00020000 "others"
    1 E/ w6 R0 b/ l. p3 n
  6. mtd3: 00200000 00020000 "parameter tags"% h4 M* W: i' d) [; d; M3 q1 g
  7. mtd4: 00200000 00020000 "wlan"
    , C3 z+ |& V  C) `
  8. mtd5: 00800000 00020000 "usercfg"
    2 b3 m1 d( v% X% `, y8 l! H1 I8 D
  9. mtd6: 00200000 00020000 "middleware"7 K1 Z1 T1 @# k! \( u1 |- w0 A& O
  10. mtd7: 03000000 00020000 "kernel1"; X; _: S0 H8 W3 t3 e/ u
  11. mtd8: 03000000 00020000 "kernel2"
      b! b" I" q: |) d& s' @  u
  12. mtd9: 01000000 00020000 "framework1"0 m& L0 ?% m: P( ~' g
  13. mtd10: 01000000 00020000 "framework2"
    ; W: F5 C/ x8 A7 }7 s# G; }
  14. mtd11: 01800000 00020000 "preplugin_data"
    ) U) l8 E3 Q; @1 v: A% [
  15. mtd12: 05600000 00020000 "plugin_data". O4 v$ S; e+ \4 \/ Q/ [
  16. mtd13: 02fe0000 00020000 "rootfs"
复制代码
可以看见有一个MTD0它就是一个完整的nand flash影像把它拷贝出来就是一个完整且连续的flash备份,有人会说下面不是有MTD1-13,分别拷贝不方便点吗?
9 U4 `8 h  L6 j6 u- f( Z, ^1、mtd1-13 加起来是超过256MB的;
( Z5 w! E: u: p9 w  n1 W2、你不知道它mtd1-13在flash存储地址是不是按1-13这个编号连续分布的;
- d: W" Z6 `% o0 K5 i0 Y, H& d/ u4 P% B1 G/ H2 i, @
我查过启动信息如下:(我没看出来有MTD地址分布信息. Y( N2 c' Q2 g
  1. /opt/cu/apps # ./busybox1 dmesg" [: H: q' V, V/ T3 z$ Y, ?7 d
  2. NET: Registered protocol family 24
    4 }1 `+ Y! s. e$ {1 C2 m! `! N, D$ @
  3. p p t p driver version 0.8.5
    : b  s* b) ~. [  R+ N; ?3 A
  4. 127s doesn't have USB3.0,just return -ENODEV
    ) v/ n" X/ d4 z$ I7 }
  5. **********TOP_CRM_BASE+0x2c=0x11393ff3******* e) t! m- c4 l& I2 k8 X: g: v
  6. **********TOP_CRM_BASE+0x2c=0x113f3ff3******
    6 U7 M# y* U& r/ k. y0 N% x, k$ S
  7. dwc2 9000000.usb: 1792 invalid for host_rx_fifo_size. Check HW configuration.
    0 J( j- f/ m+ e9 o  f
  8. dwc2 9000000.usb: 1024 invalid for host_nperio_tx_fifo_size. Check HW configuration.
    0 ~7 g7 r" q5 p  G% ^
  9. dwc2 9000000.usb: 1024 invalid for max_packet_count. Check HW configuration.+ S, O- E  t! E( s; x
  10. dwc2 9000000.usb: DWC OTG Controller
    0 l$ y0 z% H% d8 S4 w
  11. dwc2 9000000.usb: new USB bus registered, assigned bus number 1
    7 b  \+ w( L5 }7 @% ]* P
  12. dwc2 9000000.usb: irq 60, io mem 0x00000000& b' X) m, d' {0 C
  13. usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
    - k4 Y7 a( M# w% h
  14. usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    $ @$ _7 }: F- c# m
  15. usb usb1: Product: DWC OTG Controller
    ! [' l) I8 R6 m- t& [7 z
  16. usb usb1: Manufacturer: Linux 4.1.25 dwc2_hsotg
    & t+ e, G& F* P+ X6 h
  17. usb usb1: SerialNumber: 9000000.usb& ]3 s  V* p( L; z" _0 p# v. A
  18. hub 1-0:1.0: USB hub found- D; _$ n, [" \- {1 B
  19. hub 1-0:1.0: 1 port detected; e  h: V% U9 P7 B' A0 y4 S4 \
  20. usbcore: registered new interface driver cdc_acm  d7 q2 g" C! \. I. l4 H( R, {6 [" r
  21. cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
    4 ?$ ~8 \0 @, |" [% \' E
  22. usbcore: registered new interface driver usbserial
    : W4 C, l% Q; {. A2 R$ v, k* [
  23. usbcore: registered new interface driver usbserial_generic% K( Q1 \9 R; k9 {9 y: H
  24. usbserial: USB Serial support registered for generic' p% K: ^3 b8 @3 A/ S
  25. usbcore: registered new interface driver ch341
    7 F* S* A, t0 {
  26. usbserial: USB Serial support registered for ch341-uart( C5 {  |' ]: Z
  27. usbcore: registered new interface driver cp210x$ o$ C; V3 I( }6 l- x' q: W
  28. usbserial: USB Serial support registered for cp210x
    , ], W( \; Q. M7 t, s# i
  29. usbcore: registered new interface driver pl2303
    , q+ c# c# ]( w$ G3 l- N3 I5 g
  30. usbserial: USB Serial support registered for pl2303$ a% @+ I/ \9 A
  31. mousedev: PS/2 mouse device common for all mice5 t8 e. r" `/ C: Z3 v/ Z
  32. I2C probe start!
    . d. [* y) c' h
  33. zx_i2c_probe i2c-1 i2c-1->clk is ccdce7c0 ,clk rate is 1000000003 J3 Q) `7 C- C& X9 y$ G
  34. I2C probe successed!& B. _0 l5 s# v3 N
  35. usbcore: registered new interface driver usbhid6 P8 H+ {* k7 d* N. w
  36. usbhid: USB HID core driver
    7 d. t2 w; {' Y( }+ [& ]$ k
  37. zx tempsensor: zx_bsp_tempsensor.regs = 0xf0500034,&(zx_bsp_tempsensor.regs->cfg)= 0xf0500034
    & ^+ r7 O! Q4 y( [! @
  38. bsp_temp_start,val = 0x2ef
    2 ~/ m* E, x+ u. U+ c. U: E6 o
  39. (458):creat proc files for temper sensor!!!
    $ a2 J: S) X6 |0 J* M# {
  40. (463):temper sensor is running...9 b2 ^/ w+ ^( s+ m0 \- ]
  41. zx tempsensor: work clock 0
    ) V0 }" w8 i8 K9 }7 f/ n. V& D
  42. zx tempsensor: selector0's int num 27 allocated.
    7 j% B  S5 F6 \# b" E  n: A+ T
  43. zx tempsensor: selector1's int num 28 allocated.  t# P. M1 }/ Z5 T8 [- j. F
  44. zx tempsensor: selector2's int num 29 allocated.: A: x- P0 s7 l! k
  45. Netfilter messages via NETLINK v0.30.
    % l( V; f% Y$ _# U- h
  46. nf_conntrack version 0.5.0 (3372 buckets, 60000 max)
    4 r# N" V, m( I# @6 v
  47. ip_set: protocol 6
    . f0 Q& t+ z& j1 S- h
  48. gre: GRE over IPv4 demultiplexor driver( D! Q; x9 ^+ H
  49. ip_tables: (C) 2000-2006 Netfilter Core Team* @0 S+ F6 l$ s- ?
  50. NET: Registered protocol family 10, n8 G7 p- o7 @! V
  51. ip6_tables: (C) 2000-2006 Netfilter Core Team
    4 T0 ~1 k$ S2 w) S2 @! k
  52. sit: IPv6 over IPv4 tunneling driver
    6 t, @$ o- o3 i4 w" C
  53. NET: Registered protocol family 17
    3 c. u" b2 K. G- a; w) \  J" ^
  54. bridge: automatic filtering via arp/ip/ip6tables has been deprecated. Update your scripts to load br_netfilter if you need this.2 Y% I) u, s. J1 l' k+ @# r
  55. Bridge firewalling registered
    " G* N4 s" V- K6 F  i5 v
  56. Ebtables v2.0 registered2 Y2 u3 a) r) n) F) ]' w
  57. l2tp_core: L2TP core driver, V2.0
    7 l8 A/ l; w& F+ g
  58. l2tp_ppp: PPPoL2TP kernel driver, V2.0
    6 w# N, n+ F5 T" k9 Y
  59. 8021q: 802.1Q VLAN Support v1.8
    2 |6 b. m  l, l
  60. systools version:v0.7.5
    5 J" J. Y' \7 P) N
  61. zte--oss cpu usage module init4 r7 Z  f. @# g8 @, m7 [8 F$ _
  62. DPI interface Loaded
    $ j' }- d- \9 i3 C# C
  63. e8_init OK!
    2 o' j( K! Z( h
  64. Registering SWP/SWPB emulation handler1 p: x* _- I3 X7 H  H/ o1 V
  65. FLowRL module init* F5 s0 f2 [+ Z6 e* U
  66. DevBw module init
    / J9 I0 ?6 V1 p- m) |$ {% B
  67. jffs2: notice: (1) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.9 I  J% H* B# v4 j8 \' L
  68. VFS: Mounted root (jffs2 filesystem) readonly on device 31:13.
    0 S4 N( A3 w; w/ [# H
  69. Freeing unused kernel memory: 212K (c07d3000 - c0808000)
    : o- h( C5 r: m4 w: u  Z6 I
  70. This architecture does not have kernel memory protection.  I  J) k& D! a  O* L5 b
  71. jffs2: notice: (532) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
    % x' t( s  N( G  |9 O% ]# w9 T
  72. jffs2: notice: (577) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.+ I2 R2 r6 z3 @5 }. o
  73. jffs2: notice: (585) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.0 B* f# ^& Z. @1 t1 R# a: D; l+ {) I/ r
  74. jffs2: notice: (587) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.6 {3 S/ a; k/ L% b6 @
  75. 11930:23:02 [Klogfile][Error] [(1348)CheckLogConfFile] CheckLogConfFile%CheckRestartCntConfFile
    3 N( _( K% b# ]) t2 h) X8 ?6 Q. [

  76. % d) e' q# y; ]+ r  R
  77. jffs2: notice: (578) check_node_data: wrong data CRC in data node at 0x006d5d7c: read 0x19d3a03, calculated 0x1e78a0ef.
    , H; p8 C8 P& ^& O$ e6 t
  78. ubi0: attaching mtd12
    2 H- Q% a9 z7 b( X
  79. ubi0: scanning is finished$ y" |" P  z5 @3 T; G
  80. ubi0: attached mtd12 (name "plugin_data", size 86 MiB)
    . c2 p& ^" k1 q( @  J4 N
  81. ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes# {9 {0 m4 N! `
  82. ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
    * `% l* ]8 M8 a6 I9 N% k
  83. ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
    4 \' I& P" ]1 g! G6 w
  84. ubi0: good PEBs: 688, bad PEBs: 0, corrupted PEBs: 0* T" i" r) H; o2 ]8 W, t0 X' y8 t! H
  85. ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
    8 D0 M, q" s8 J
  86. ubi0: max/mean erase counter: 14/9, WL threshold: 4096, image sequence number: 2012089330; L- u& s! l+ n$ I4 H( X3 a0 m( |
  87. ubi0: available PEBs: 0, total reserved PEBs: 688, PEBs reserved for bad PEB handling: 16
    7 _! M! O5 P, U8 Z( m) [
  88. ubi0: background thread "ubi_bgt0d" started, PID 601! w6 \* g2 a1 L, z+ c% Q
  89. UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 607- f8 R) Z  I8 |. R, w* x7 w  X$ Z
  90. UBIFS (ubi0:0): recovery needed
    + S6 C# X( s6 U, k8 o8 X' A
  91. UBIFS (ubi0:0): recovery completed! d% N7 \4 ~5 e, C% [8 X
  92. UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "plugin_ubifs"8 ]# O2 Q; Z' `7 z& C5 x
  93. UBIFS (ubi0:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes/ k  s# H& E1 D4 v
  94. UBIFS (ubi0:0): FS size: 83423232 bytes (79 MiB, 657 LEBs), journal size 4190208 bytes (3 MiB, 33 LEBs)
    $ A, f7 k: X# }/ [: {( U
  95. UBIFS (ubi0:0): reserved for root: 3940284 bytes (3847 KiB)/ M1 ~/ J; L: J# X( N: y* R0 S. u7 X
  96. UBIFS (ubi0:0): media format: w4/r0 (latest is w4/r0), UUID 156BD46D-0725-43B0-AA2C-8A8DCD1D83F4, small LPT model5 V7 ^1 R+ q* K# s
  97. jffs2: notice: (618) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
    1 O$ v8 l' q5 C  u" |* q
  98. lo up% L0 V* b3 D& q. V) G% t; k7 ^, e
  99. mux[0]=3f7ffffa6 o6 j9 n5 y! e! r5 B# P$ o7 A
  100. mux[1]=3ffffeff8 k6 t) ?0 C$ T! S* I2 [
  101. mux[2]=19ff0555
    0 k+ J2 E" s8 P9 P, q" w
  102. mux[3]=6be1b
    7 i" h* `8 S; N2 k
  103. storage_wakeup_proc_create success!( K; d4 P5 E4 O+ i& P1 N
  104. verinfo=U-Boot V1.0.0P1N1 20210911001937 0x1200000 0x0 0x8f 0x83
    0 P- E2 V; T/ E& D4 h0 ~8 G
  105. can find /usr/java/osgi_verosgi_version_info_get error!$ r) y, C  v+ E, k# P# {
  106. data_in=0x06 X0 l1 W: E* n
  107. data_in=0x0: E7 f* g- g" D1 N
  108. >>TagaramodInit the typeindex:  5 1 c* |( ?+ Z2 H' M$ v3 B2 v! T# ^
  109. >>TagaramodInit the board_name:  F657GV9 ,wan=0x40
    % n$ \! B4 U' s
  110. pon init* w: ^) |+ b7 V
  111. ZX_PA_BUF_BASE0=4dea0000
    # K" g5 U$ F" `1 A
  112. ZX_VA_BUF_BASE0=cdea0000
    * x: j$ a/ \! g) u. f9 e1 g. b( `
  113. ZX_BP_BUFFER_BASE=4dec0000
    9 Q9 u* v+ E, M/ r# V
  114. ZX_DESC_BASE=4ee80000: N) W$ j: I4 [$ [
  115. ZX_TX_UP_DESC_BASE=4ef40000
    $ S8 N8 y" N+ n% |
  116. ZX_TX_DN_DESC_BASE=4ef50000. B' z1 D5 C6 e! d: a6 b6 n/ i
  117. ZX_BPPE_SW_BASE=4dea0000  Z  O" A4 s% k% J0 y6 k
  118. ZX_BP_BUFFER_SW_BASE=4dec00000 P  E8 \) l0 L, a; n: z- E2 m5 G
  119. ZX_DESC_SW_BASE=4ea00000$ a6 H8 ~0 `# i# }  }* H' x
  120. ZX_TX_UP_DESC_SW_BASE=4eac0000, b: G* v- a- [; B: C
  121. ZX_BPPE_BASE_127S=4eae0000+ P+ Y, P, N/ L: V* f. D
  122. ZX_BP_BUFFER_BASE_127S=4eb02000
      X" _1 K) b9 j2 N4 r; M
  123. BP_BUFFER_SIZE_127S=b40000
    ; C1 R: B4 W7 u: O' D1 k% @7 t
  124. ZX_VA_TX_DN_DESC_BASE=cef50000& h3 n$ X! t' f( H  Y) M5 c  p
  125. BPPE_POOL_SIZE=1c00
    ; K% |- O+ W( P- E6 m
  126. NORMAL_BP_BUFFER_SIZE=fc00001 I; G2 Z5 ^% m$ D6 n5 G( W- T
  127. JUMBO_BP_SIZE=2800& A$ N" w( e7 V3 W
  128. JUMBO_BPPE_POOL_SIZE=0: ~* G9 ?* c) r. k
  129. BP_BUFFER_SIZE=fc0000
    6 ]0 X, \' o# k- d5 y' f2 u
  130. lan_up=0, lan_up_port=00 H4 n  H5 n' r* ~
  131. the pon mode is 40& N  n% a7 ]$ U3 C: k' o' Y3 c6 b  _
  132. lan_up=0, lan_up_port=04 h4 M; [9 U0 B
  133. g_pon_irq=36,d1000000,f0400000,f0500000,f0600000,d0e00000
    , u( V3 a$ o, E, A
  134. get npp irq succeed,g_npp_irq:38
    0 k& E; T0 j+ G. q# D% x- p
  135. get tm irq succeed,g_tm_irq:41 tm_base:0xf4340000
    1 U2 V8 U$ a! f' E
  136. get pp irq succeed,g_pp_irq:376 _, N- W' ?7 p7 Z
  137. get idm irq succeed,g_idm_irq:39
    1 y. E" Q% l* Y' a3 O% M% K
  138. enter ref_clk_set.. mode = 0 .
    + X0 a' ?' Q! U! d1 ]. L, _
  139. enter pll_cfg_fractional0 ~' N2 d  P5 O1 h
  140. ref_clk_set success!3 l5 `8 H$ ?/ ?* E
  141. serdes band cpu_temper:32 coarse:0x29
    % `8 U/ K+ O/ }/ Y) f# `5 v
  142. band calc fin
    $ i4 E$ i0 P& N1 n2 h, B" O
  143. pon tm init5 y  q# W) y# S1 s) A7 ]
  144. enter pon_tm_bppe_pool_init
    ( C4 z* D9 N. @
  145. bppe_va_addr = 0xceae0000
    . ]9 S: ^& B9 b8 K: T
  146. jumbo_bppe_va_addr = 0xceaf0000
    6 _. s( i6 O7 m- I
  147. BMU_JUMBO_BPPE_SW_PTR  =0x0    (JUMBO_BPPE_SW_POOL_SIZE)<<16=0x0 % w+ V7 G7 E+ \9 q* c" N- j
  148. netif_napi_add() called with weight 512 on device pon4 U* }! H  J8 k" I
  149. DMA_UP_DESC_CNT = 0x0
    - P3 \  T% Z8 K2 k
  150. pon_tm net init ok,272/176, ~; R) x3 q$ E
  151. pon_pp init; y' G2 Q2 Z: j* ?. v3 Z) c* R
  152. pon_npp init
    2 X# Y- e. |9 U" \
  153. idm_status_proc success!
    * o) y5 _: [, R# {' B8 {6 \0 `+ G" Q
  154. idm_desc_init d0c35000/4c9800002 D: x0 b  t; E/ O
  155. request idm irq succeed - S' f' @) I0 [3 d5 h: j4 Y
  156. idm net init ok
    7 L3 ^3 ?7 a. Q# B" n- ~
  157. switch_phy_int_check 0 7 I& u1 y% u. ?( [
  158. mac 0 link down# j' l  i* V( s/ U
  159. switch_phy_int_check 1
    ) Q8 e9 U' I8 U
  160. mac 1 link down% |! ^( [+ ~- y  H& f
  161. switch_phy_int_check 2 8 o1 I1 r7 o- s  d3 l% s; [0 E
  162. mac 2 link down
    2 Y, C0 |% `; h* O
  163. switch_phy_int_check 3 ' A0 Q$ n2 _) l& p  L; D  ~2 b
  164. mac 3 link down8 U4 {5 F2 k5 E- Y1 r
  165. register fpga driver success, major=2223 A: N, Y, L, A! s5 n
  166. register peripheral success, major = 106" E! i4 G1 {2 v  P9 v
  167. = TM Module SYS FS Init ended successfully =
    ) L5 Q/ L3 u4 k& t8 S2 h
  168. tm_initModule begin...
    ; |6 {7 x" b$ k/ q! k' i: D
  169. enter tm_sdk_init  
    ! X8 z# ?, U/ g6 T4 |2 a
  170. api lock init!!$ ?7 b2 s" u# y# e$ ~% P
  171. tm_initModule end...
    " x+ M. |' U( x7 t9 e
  172. hw_power_optx_get_fordg:txdisable=0
    ! T$ Z, Z1 P% ^( d
  173. Kmodule ZX279511.ko insmod successfully !6 y& E; \' l9 E9 M8 [/ V1 S
  174. bob is not GN25L95: 40
    ) K( I  j, V7 {% t8 @, s! N& i" j
  175. pon up
    . s& z9 |. ^2 M$ m0 t
  176. ethdriver_init....3 l* W( L% r+ a( d. B3 b
  177. g_mii_dev_name[0]  sw
    / K2 k$ Z6 S# t0 f2 c. U9 U
  178. g_mii_dev_name[1]  pon 0 O4 d: I. v" {3 v. W$ Z
  179. sw up
    6 n" M" Z: I- n5 s/ V. G
  180. zteGpmac_devReg begin...
    5 {0 [. J' ~# O( j0 [$ h( |, h1 p
  181. zteGpmac_devReg end...3 f0 L) d3 ^- ~/ c4 t
  182. enter zteGponCpuTypeAddrSet : K$ G3 L) p4 F9 q8 ~
  183. *
    % Z+ x+ z; _7 B9 t* i- u
  184. asicGlbDb[97], 0x46,0x31007,0x0
    ) ~, p' [- V6 {' X, ]
  185. zteGpmac_initModule begin...9 N! [8 X5 w. R4 f
  186. === GponMac Supported MaxTcont: 16 MaxPLI: 800B ===
    ! L" K) G1 F7 ]2 F8 f, P" g) y5 S
  187. htb debug 1 =====> inCnt =0,outCnt=07 A; U! ~/ t4 F; ~% s
  188. ##huoqf zteGponAsicStarttimeChkResultInit write cfg=10 ! q* i9 b2 z) S6 r, e, @
  189. ##huoqf zteGponAsicStarttimeChkResultInit read cfg=10
    9 @5 _6 w# h0 m/ X1 M
  190. = PON Module Operate ended successfully =
    3 r1 E0 `1 X0 M* e
  191. DEbug: GPON PIN_MUX_REG2:(0x19ff0555)
    ; {7 T% L9 q; {7 x
  192. DEbug: GPON GPIO_PDD_REG:(0xfac)
    9 l9 l$ {; ]4 S  _9 q- G/ {$ D3 x
  193. DEbug: GPON GPIO_POSEDGE_REG:(0x4)" e" M: H2 X4 s4 B; i
  194. DEbug: GPON PIN_MUX_REG3:(0x2be1b)- G0 V) z5 x% Q. k9 P+ S% R! w% f
  195. create zteGpon_rei_task ok!
    3 a1 o  L& C+ U& M' K, N: w) N
  196. = GMAC Module SYS FS Init ended successfully =
    ; Z* e* J# b3 M) P( |- |- C
  197. zteGpmac_initModule end...7 _" |" S, z! B% p+ @0 @
  198. gpon_Init ok
    ! \7 h% @  i8 q6 d# P$ Q; K
  199. gpondrv g_OnuType is 2
    ! v( P" C9 `! j1 }
  200. 11930:23:06 [KMONITOR][Warn] [monitor.c(607)MontorSendMsg] netlink_unicast failedmsgid = 0xa5c2, ptr = bf26dd20, len = 4
    ( m% X" d) x# r  ~; M+ C/ q
  201. omci up6 {4 R; |2 ~  A/ V) i6 V
  202. Init switch module; ?6 U7 n+ N, ]* q) F
  203. unicnt 4, wancnt 1, wifi cnt 0, all ports 5, portmask 0x0000002f& `2 h+ m4 d( P* r# s& s% ^
  204.   Onu type is 1,Wan type is 4: T( e3 p' U* h: g  O
  205. switch config GPON HGU mode!
    ; h' c9 F, c! q* S  z  G
  206. protocol fail, error deal 66, `, z- M/ k4 ^  y) H" x9 U
  207. [TM][dpa_set_protocol_type_i_act] failed, x6 K1 U# U: S! p* v: }
  208. protocol fail, error deal 65
    5 A5 e( s* {0 }# x$ R4 I: X0 N
  209. [TM][dpa_set_protocol_type_i_act] failed
    * P% x3 n: n- r3 `& O
  210. -------chip_tm_init end-----
    2 ^' [- P" a* h4 W; c4 l
  211. [SW][sw_init_switch] l2_fast init
    2 x1 X8 j2 ^: W) R$ X! {( ^6 U: W# i. w
  212. [SW]set cpu queue rate limit to 8000pps( V# k! l; n) `: f' ^8 R
  213. tm_port_egress_traffic_sharp_set p_port:5 p_ena:1 p_band_width:2048
    - G' j& [0 t' B) a9 J3 o) D

  214. 0 G% K+ P& H$ ~) E; @- W9 I
  215. Capacity=256000tm_port_egress_traffic_sharp_set p_port:6 p_ena:1 p_band_width:2048
    ! @0 h. ~: {/ l4 G( x8 P& X7 Q

  216. 1 q6 C6 ]5 o# z3 R8 G) |" E0 K9 w/ U
  217. Capacity=256000[SW][sw_init_switch] reg hff
    & C9 l5 x9 h4 i9 h- U# J
  218. [SW][sw_init_switch] reg get statistics 3 q: I) Z/ z% j8 s7 v
  219. Init switch module Success
    1 B4 G+ w: y) q6 E2 x; h
  220. bsp_i2c_probe 0x50 success!: Y" Z* b2 Q- @; R6 B# Y
  221. vendor name = ZTE_PX20+_G 1 v) M) _" w8 d
  222. optical PN(0x60) =   d2 Q. \  O- a" M3 \9 ^
  223. optical PN(0x28) = ZX2795119 o* j) T/ j) P1 y
  224. tdm: exports duplicate symbol tdm_ch_close (owned by kernel)& W2 L8 l+ |" q% D, E$ {! f
  225. udpwatchd inited!
    1 c* Y+ ?. B& x% H
  226. kudp  inited!
    6 C0 r0 U1 N  o! B
  227. Init codec v2.3(2019-05-17)!! v" n! S7 q# C" [" e( R6 r3 q
  228. idm0 up7 X4 |7 w8 W9 S4 i2 t* v3 Q4 k
  229. idm1 up9 F/ k( N/ U1 G3 z& w% S
  230. redirusb_init,no usb dev!
    % w* e' }# E* F& J" S0 K3 |' c
  231. random: dbus-uuidgen urandom read with 47 bits of entropy available
    # H) ?; J: ^" T/ G  L) n- \7 Y2 N
  232. gpondrvCfgXGRegInfoAdapter not support now!( G* A) e3 Z  b" s* R9 c5 \9 z
  233. === GponMac Supported MaxTcont: 8 MaxPLI: 1536B ===
    0 b* n1 g, p2 ^' P% o0 |" l7 B& p
  234. htb debug 1 =====> inCnt =0,outCnt=09 c9 D2 b2 s; q: t
  235. IPv6: ADDRCONF(NETDEV_UP): br0: link is not ready) S0 m7 d$ v: L3 N$ n/ o; [
  236. br0 up
      ]9 ]. u3 W/ }: \  Z
  237. ethdrv_dev_ioctl  ,brdev_set.port_id 0 ,brdev_set.name eth0 ,brdev_set.flag 0 - u4 ?' Z" h  K; o5 i2 R  u# N& J
  238. eth0 up
    8 }$ ^2 p: e5 m8 k3 r
  239. ethdrv_dev_ioctl  ,brdev_set.port_id 1 ,brdev_set.name eth1 ,brdev_set.flag 0
    + E: e) c# g8 F8 }
  240. eth1 up
    ' Z9 a) f; N3 w# l- W2 L+ D; r4 m& t
  241. ethdrv_dev_ioctl  ,brdev_set.port_id 2 ,brdev_set.name eth2 ,brdev_set.flag 0 0 K! }7 b3 h% U4 r4 z( s7 b
  242. eth2 up, p, ^  v( Q' C6 \5 Q$ H; l& ]
  243. ethdrv_dev_ioctl  ,brdev_set.port_id 3 ,brdev_set.name eth3 ,brdev_set.flag 0
    , V2 D, i" p8 b) f
  244. eth3 up
    * Y1 G* x: v9 N. L0 }5 t- C
  245. tm_port_egress_traffic_sharp_set p_port:3 p_ena:0 p_band_width:0# _  e( W6 B( J5 T/ f1 V8 M
  246. * ~- Z$ v, t0 e3 ]/ a7 y
  247. Capacity=200000tm_port_egress_traffic_sharp_set p_port:2 p_ena:0 p_band_width:0) Y' |* W  z+ z* j0 V$ U9 A; z
  248. " q3 M3 V! v: d* `$ N& a) N( `) [; p
  249. Capacity=200000tm_port_egress_traffic_sharp_set p_port:1 p_ena:0 p_band_width:0
    1 G# s9 t/ E3 E2 S+ ^
  250. & V* U0 E# T( K: {. {4 s
  251. Capacity=200000tm_port_egress_traffic_sharp_set p_port:0 p_ena:0 p_band_width:0
    6 S% g# ^& Y3 J: P" E; e2 R. o. l
  252. # {# d4 x7 C! L5 s/ a; [8 p
  253. Capacity=200000) z* x% m: O9 C; v; b& V, l
  254. switch_phy_int_check 1
    6 w' J: j/ p1 A1 ]# ?
  255. pon0 up
    - [& Q" `, I/ N$ _
  256. set_netdev_type dev (pon0) type (300) vendor name = ZTE_PX20+_G + Z: d$ l+ x) ^# `' ^
  257. optical PN(0x60) = $ u6 e, \/ F! ^* }  {2 d
  258. optical PN(0x28) = ZX279511
    0 l$ C3 {* w$ q" |1 C3 Q
  259. device eth0 entered promiscuous mode! C; t& Y4 K5 Z
  260. set_netdev_type dev (eth0) type (800)
    + V6 C5 }8 O) r+ H
  261. device eth1 entered promiscuous mode
    - H, w  X( \9 _3 i' t( R; y
  262. set_netdev_type dev (eth1) type (800)
    ; v& j- j/ r% R% X; b8 t+ t
  263. device eth2 entered promiscuous mode. }4 J1 m) r9 A! s4 c
  264. br0: port 3(eth2) entered forwarding state
    0 ?. |- D+ j) [5 T0 a( q3 C
  265. br0: port 3(eth2) entered forwarding state" R5 H6 ^  {- \; [  _
  266. IPv6: ADDRCONF(NETDEV_CHANGE): br0: link becomes ready
    $ }/ m3 m3 ?; Y% w" s) m% Y9 V
  267. set_netdev_type dev (eth2) type (800)
    7 o# r2 m* h3 t) J' b6 n
  268. device eth3 entered promiscuous mode
    3 O0 e5 q- @5 F& c0 ?
  269. set_netdev_type dev (eth3) type (800) set_netdev_type dev (pon0) type (300) set_netdev_type dev (pon0) type (300) set_netdev_type dev (pon0) type (300)
    9 u9 y7 l! d  \: c# M
  270. ch:0 pcm mode:G711A_U & C/ P1 b) M1 e
  271. Siliconlab chip id error! 0x0 & ]5 D5 {9 O, Y8 ?3 j* `0 \8 t" p
  272. cmd [ck 1389 1] not found
    ) F0 c& k, S8 p1 D7 v" y7 D# F
  273. ====EVENT_O7_STATE_SAVE OFF====
    8 v( O/ |5 F# `. t& J$ q# j
  274. cmd [ck 1392 1] not found
    + y+ V1 d) B' d) K
  275. cmd [ck 1387 1] not found
    2 S: G9 o1 P5 X, x
  276. random: nonblocking pool is initialized
    5 A. V/ U9 g2 O: N( N
  277. device br0 entered promiscuous mode
    & u7 ~, f  w) B% |6 g
  278. tm_port_egress_traffic_sharp_set p_port:5 p_ena:0 p_band_width:01 \1 v  b* V5 V

  279. ' h+ b5 U! ^* \0 Y# G- q
  280. Capacity=200000tm_port_egress_traffic_sharp_set p_port:6 p_ena:0 p_band_width:0
    5 }  O" ^0 f" Y, i

  281. 0 q& O" a6 @2 x# q( A' B
  282. Capacity=200000
    - c% |" v/ b( C8 I- w* [; J
  283. overlayfs: missing 'workdir'
复制代码
0 `6 ^, D8 l% H8 |5 f! [
但是将这个mtd0自接考出来是不容易的,因为它的内存也就256MB,临时分区也容不下这个falsh影像/ Q5 |0 r3 i. l6 p
  1. /opt/cu/apps # df
      Z6 K% t( [0 s. V
  2. Filesystem           1024-blocks    Used Available Use% Mounted on
    4 m$ m/ f5 Y6 _# k. A
  3. /dev/root                49024     37824     11200  77% /
    7 L. N- z) h. P: `
  4. /dev/mtdblock3            2048       404      1644  20% /tagparam
    3 _; [$ q. J3 F
  5. cgroup_root             108016         0    108016   0% /sys/fs/cgroup
    6 }6 S1 _0 W) W
  6. none                     21604         0     21604   0% /run! ~. y7 Q- F; @: `6 l" ?  q. H' T
  7. none                      5120         0      5120   0% /run/lock+ k9 D# a, P' v  ]( ?( |
  8. none                    108016         0    108016   0% /run/shm7 H5 P! s3 f& {3 y( b  M6 b
  9. tmpfs                    20480       448     20032   2% /var" l# {" z) o3 J: A, T# x
  10. tmpfs                    81920      2800     79120   3% /upgtempfile' U. B; @. f2 V# z% m
  11. tmpfs                     2048         0      2048   0% /mnt. R* L, C) y+ b# W, A
  12. tmpfs                    15360         4     15356   0% /tmp# e1 k4 F' ^8 ?( G" y8 r
  13. /dev/mtdblock5            8192       640      7552   8% /userconfig0 I* M( b9 J2 o; @
  14. /dev/mtdblock6            2048       384      1664  19% /usr/local/ct5 q  H8 Q& [4 ^- A  C9 q6 R
  15. /dev/mtdblock11          24576      6232     18344  25% /usr/tmp
    3 K8 B( L8 E4 b! _( |
  16. /dev/loop0                5376      5376         0 100% /usr/pre_plugin
      m- \+ Y! p/ X0 V
  17. ubi0_0                   74660      2864     67948   4% /opt/cu/apps2 u  Y' K; X4 R- Z; h7 k7 z  a
  18. /dev/mtdblock4            2048       436      1612  21% /wlan7 G% }. H1 j' K4 g. [
  19. overlay                  74660      2864     67948   4% /CuInform) h$ e/ r: k1 E9 ^8 S/ }: }
  20. tmpfs                     5240        24      5216   0% /CuInform/tmp
    8 ~3 ?* W& H# T, P* L- m" s$ L& F( I
  21. overlay                  74660      2864     67948   4% /usr/sbin
    " \1 e3 [# U1 X$ F: Y
  22. /dev/mtdblock9            4352      4352         0 100% /opt/cu/framework
复制代码
可以看见也就/upgtempfile 文件夹可用,大小为80MB,远远不能满足需求。
2 r8 f" l2 }9 O  p7 X7 j: ?% T! y: A3 ]  K' Y
以上都是分析,下面是操作步骤:( _4 ^; {( b& p$ q! e
方法一:采用压缩方法在拷贝flash的时候边拷贝边压缩,然后将压缩后的文件传给电脑:- k6 p5 p( t# S- _; B
  1. dd if=/dev/mtd0 | gzip > /upgtempfile/mtd0.gz
复制代码
我使用上述方法临时目录还是无法容纳,只有用更强的压缩方式,linux中有一个.xz文件它使用LZMA的压缩方式,LZMA压缩比相比较zip高不少,但在busybox中的命令xz只能解压这种文件,无法压缩。只能从网上下载完整代码自己编译一个。" o* X# ~7 w) n0 q% N
  1. /opt/cu/apps # ./xz-v5 -H2 t; z7 M, l0 ?0 U, G# u
  2. Usage: ./xz-v5 [OPTION]... [FILE]...* Y% }2 S' S  Y" G
  3. Compress or decompress FILEs in the .xz format.! c" f$ ~3 V# l

  4. 6 Z+ U" _: O) R
  5. Mandatory arguments to long options are mandatory for short options too.
    3 r0 y  \+ h9 Z; ~
  6. 6 z. R9 ?, X- Y, G
  7. Operation mode:
    ' }3 ?$ C* L5 w
  8.   -z, --compress      force compression5 i: d' }# H; a+ s' V- C& A2 |  c
  9.   -d, --decompress    force decompression
    3 N  G3 Y- i6 e9 Y
  10.   -t, --test          test compressed file integrity) `) I& {- v! M
  11.   -l, --list          list information about .xz files4 }7 {3 \9 L" A$ E! I0 J* L
  12. ! s/ }3 I3 w6 ]; Y  ^, F" F
  13. Operation modifiers:- s5 h+ a% T  J, q
  14.   -k, --keep          keep (don't delete) input files  H2 v$ B6 l! a, X! E$ A, {
  15.   -f, --force         force overwrite of output file and (de)compress links
    5 D4 b/ L, H: b
  16.   -c, --stdout        write to standard output and don't delete input files
    ! Y9 E& p& ~7 U
  17.       --single-stream decompress only the first stream, and silently
    1 {9 t! c% b4 \$ d7 b5 [4 U
  18.                       ignore possible remaining input data
      g& s; C3 h1 V5 a
  19.       --no-sparse     do not create sparse files when decompressing
    * x% N2 \! f2 r1 O& j
  20.   -S, --suffix=.SUF   use the suffix `.SUF' on compressed files
    ) r+ [6 D  _1 h' @
  21.       --files[=FILE]  read filenames to process from FILE; if FILE is. q' V3 N7 [7 P$ z
  22.                       omitted, filenames are read from the standard input;' K' X) {* z( s6 B0 l% l5 V
  23.                       filenames must be terminated with the newline character4 {3 b0 x7 N& S  O1 D/ W
  24.       --files0[=FILE] like --files but use the null character as terminator- q+ p* N$ j& J/ r* h/ i8 }; W
  25. . K9 B4 p6 C* r
  26. Basic file format and compression options:9 U! ], z$ I$ m# q  X2 z1 x! S5 C
  27.   -F, --format=FMT    file format to encode or decode; possible values are
    9 ?- {9 a9 T6 P1 j) b4 ]; _- c) f
  28.                       `auto' (default), `xz', `lzma', and `raw'
    # g& c4 D" n# z/ E% }6 }+ O
  29.   -C, --check=CHECK   integrity check type: `none' (use with caution),
    # K! b  p: d9 q. X7 c/ h
  30.                       `crc32', `crc64' (default), or `sha256', _' ?0 L$ n9 ~, s: v8 d
  31.       --ignore-check  don't verify the integrity check when decompressing* _! S/ l' {$ ], i- v, J' j9 c# O
  32.   -0 ... -9           compression preset; default is 6; take compressor *and*! I$ L6 d2 l6 ?7 Y/ k% `
  33.                       decompressor memory usage into account before using 7-9!
    . E3 D/ `. x3 n; B6 i3 @, p
  34.   -e, --extreme       try to improve compression ratio by using more CPU time;
    1 a( l1 O! j, |; I" z5 z
  35.                       does not affect decompressor memory requirements
    3 ^6 V& B! c: [' O! Y
  36.   -T, --threads=NUM   use at most NUM threads; the default is 1; set to 0
    5 C- d+ L3 J# x" `( F
  37.                       to use as many threads as there are processor cores
    8 c, T) K+ a- x$ x
  38.       --block-size=SIZE
    + k' s: U2 r# M7 p' j! U) Z
  39.                       start a new .xz block after every SIZE bytes of input;2 H! f( @: l; Q, M( [# \" D
  40.                       use this to set the block size for threaded compression# K; i; I# g3 @4 F3 |$ b
  41.       --block-list=SIZES, ]/ e! m' [# g' |% }$ \
  42.                       start a new .xz block after the given comma-separated* H5 ^0 p: `& y& A5 J9 c
  43.                       intervals of uncompressed data: u# N- k+ E; B* p1 M
  44.       --flush-timeout=TIMEOUT1 j! i( {  w' `
  45.                       when compressing, if more than TIMEOUT milliseconds has5 u2 v0 q" }: h; t& f% S( F
  46.                       passed since the previous flush and reading more input+ W# m3 m! f# x1 A# y" l
  47.                       would block, all pending data is flushed out
    + y0 A" S% K% B; n2 N6 O
  48.       --memlimit-compress=LIMIT. y- H! n4 s. t* L
  49.       --memlimit-decompress=LIMIT
    7 E, P6 N* J: T& l* ]
  50.   -M, --memlimit=LIMIT
    6 t0 `2 g  k& |9 J
  51.                       set memory usage limit for compression, decompression,. `' b6 d8 x( h
  52.                       or both; LIMIT is in bytes, % of RAM, or 0 for defaults
    ; X. S' |; ~( a: {' U/ N3 p, n
  53.       --no-adjust     if compression settings exceed the memory usage limit,9 J) Q2 J1 q" B
  54.                       give an error instead of adjusting the settings downwards
    + f$ w; g1 P0 F# B  L
  55. ( Q. M$ D9 a1 A; ~
  56. Custom filter chain for compression (alternative for using presets):
    9 a- ]! E$ G, I0 i- d. f4 c# q) @
  57.   --lzma1[=OPTS]      LZMA1 or LZMA2; OPTS is a comma-separated list of zero or
    , X8 c3 ?* l4 c* o9 e! Q- n3 W
  58.   --lzma2[=OPTS]      more of the following options (valid values; default):
    1 ^6 o! o% s6 g3 k0 q. s" u
  59.                         preset=PRE reset options to a preset (0-9[e])
    - S2 O. k% B3 k3 u/ j
  60.                         dict=NUM   dictionary size (4KiB - 1536MiB; 8MiB). s+ j( F: T1 r0 N
  61.                         lc=NUM     number of literal context bits (0-4; 3)/ S+ J2 Q$ W! N5 ?
  62.                         lp=NUM     number of literal position bits (0-4; 0)
    2 Q& j- Z, s' V
  63.                         pb=NUM     number of position bits (0-4; 2)8 W- `. C4 o3 g- d3 Z
  64.                         mode=MODE  compression mode (fast, normal; normal)% b  v3 ^8 ?% L0 I
  65.                         nice=NUM   nice length of a match (2-273; 64): @* V9 b; t9 Z  q* b' |0 O" q
  66.                         mf=NAME    match finder (hc3, hc4, bt2, bt3, bt4; bt4)
    * W3 o6 P* y3 p8 S
  67.                         depth=NUM  maximum search depth; 0=automatic (default), A; `$ W+ O# M) a7 l& y
  68. + }" [) D5 F) A& Z. b3 w
  69.   --x86[=OPTS]        x86 BCJ filter (32-bit and 64-bit), f9 @5 v; F4 g  u& o; l! S# A5 t
  70.   --powerpc[=OPTS]    PowerPC BCJ filter (big endian only)  y1 z' @. K( S  D$ y# ~0 `
  71.   --ia64[=OPTS]       IA-64 (Itanium) BCJ filter4 H; W2 w2 Y9 H; U+ |" T
  72.   --arm[=OPTS]        ARM BCJ filter (little endian only)
    + S$ F0 u, ?( h
  73.   --armthumb[=OPTS]   ARM-Thumb BCJ filter (little endian only), y% D! }/ S# j4 z- B# A
  74.   --sparc[=OPTS]      SPARC BCJ filter; p) ^: b+ E8 y1 H; f  ?
  75.                       Valid OPTS for all BCJ filters:" K6 a; j* B8 ?3 m
  76.                         start=NUM  start offset for conversions (default=0); i9 O" `, ?: H0 h4 a$ D+ m6 l/ @

  77. : Y, p9 J7 C( S! i9 w
  78.   --delta[=OPTS]      Delta filter; valid OPTS (valid values; default):7 n1 _2 o3 P4 Q5 N7 C
  79.                         dist=NUM   distance between bytes being subtracted
    & I1 A5 S' A0 |  l- v
  80.                                    from each other (1-256; 1)7 G* e. D; Y; D* ~7 l2 t: ^
  81. ( O, {% K7 `  m9 N  e
  82. Other options:) n/ Q! u' `% z+ b3 ?/ f

  83. # E$ }6 Y$ v) d$ w# D/ D
  84.   -q, --quiet         suppress warnings; specify twice to suppress errors too
      T* U. _- v0 n% J3 L/ V
  85.   -v, --verbose       be verbose; specify twice for even more verbose" t' f* x& j6 C' u1 K2 c+ @
  86.   -Q, --no-warn       make warnings not affect the exit status
    ; f, X' ^# w1 q& ~# ?
  87.       --robot         use machine-parsable messages (useful for scripts)+ |6 ?" y( D0 {$ t6 Q

  88. 0 W0 k& {% y4 W9 [7 x5 V
  89.       --info-memory   display the total amount of RAM and the currently active
    + I: x+ V$ Y5 @1 F5 _0 u  I$ r
  90.                       memory usage limits, and exit3 K4 U/ F. P( k1 f! }
  91.   -h, --help          display the short help (lists only the basic options)
    7 W- G8 w1 K+ B. X3 x
  92.   -H, --long-help     display this long help and exit0 S+ z2 v/ m! ]4 R6 C
  93.   -V, --version       display the version number and exit
    ! S3 |% J/ ~5 L, ?8 W6 q0 P
  94. & \3 D' d" C" S* g+ B
  95. With no FILE, or when FILE is -, read standard input.
    1 R) ~; \: P* b( r8 j( a
  96. 5 U  U' Y8 v) W7 a3 h. V
  97. Report bugs to <lasse.collin@tukaani.org> (in English or Finnish).
    * {3 K; t9 W; |) m8 u
  98. XZ Utils home page: <https://tukaani.org/xz/>
复制代码
    到这个地方我走了一段弯路,这里要吐槽这个中兴的这个 ARM cpu (ZX279127S@A9,1000MHZ)TNN的看名字用的是A9并且查看cpu信息用的是ARMv7 指令集,编译好的文件在板子上就是不能跑,查了不短的时间才发现这个cpu要用ARMv5 指令方式编译才能跑起来,典型的挂羊头卖狗肉。
' Y: p) r  P5 ^3 b1 [' K, m# a  `
  1. /opt/cu/apps # cat /proc/cpuinfo - [# F. N- q8 s2 ?
  2. processor       : 09 ]" o& ~7 X5 Y: ]
  3. model name      : ARMv7 Processor rev 1 (v7l)
    6 k6 [+ Z1 B2 ]6 ^
  4. BogoMIPS        : 1987.37' ^6 @. z1 o4 o7 D
  5. Features        : half fastmult edsp tls ) [. A. q/ M0 B$ F
  6. CPU implementer : 0x41# g1 k3 L3 y7 A* J& U9 p6 A
  7. CPU architecture: 7
    ; a2 w9 i0 m- q/ Y8 p
  8. CPU variant     : 0x4
    / I/ R- o( |( g; n0 X' }8 N' A
  9. CPU part        : 0xc09' d. d3 f$ c+ J( \) d! }( A
  10. CPU revision    : 19 B3 A# G  W2 @; [& ~+ a
  11. 0 M4 a5 E4 @0 n5 D+ z
  12. Hardware        : ZTE ZX27912X (Device Tree)
    ! _4 I: p3 n' S% z  T1 x
  13. Revision        : 0000
    ( p8 x- u  e  g+ C
  14. Serial          : 0000000000000000
复制代码
$ }/ p  ^, R+ \" b2 i$ f. H
后面就简单了, 压缩后的文件为76.1 MB (79,894,956 字节)
8 r9 ~7 a% w- Y1 _# I. k8 o
  1. /opt/cu/apps/busybox1 dd if=/dev/mtd0 |/opt/cu/apps/xz-v5 -M32MB>/upgtempfile/mtd0.xz    (边拷贝边压缩,用-M32MB参数是因为LZMA压缩特别占用内存,如果不限制使用内存,光猫在拷贝过程后期可能因为内存溢出而重启,我这款就重启了2次,后来加了参数就ok了)
复制代码
这个busybox1 文件也是我传到光猫的,光猫内置busybox文件很简化(有tftp及chmod ),但没有包含dd命令
( r1 C+ A9 O+ x) R! F3 e/ ?1 i  f  P: o: W! V& I. H0 P
方法二:( ~, m4 n$ t; h
在以上过程中我还参考网上信息Linux 下的dd命令使用详解以及dd if=/dev/zero of=的含义发现有另外一种方式使用netcat(简称nc)传数据,这是个非常有名的工具在busybox中集成了它的简化版,busybox windows版本也可以在 https://frippery.org/files/busybox/ 下载到
( Q2 x" u2 R3 w) m, k3 i4 T* X: u

: P) S/ k0 U# @- C# z3 E) S1、先在windows中执行命令:(接收数据端)$ ?9 Y$ f# O) p+ G$ A
  1. busybox nc -l -p 12345 >mtd0
复制代码
2、在光猫中执行命令:(传输数据端)- K: R2 D3 S# s# p
  1. /opt/cu/apps/busybox1 dd if=/dev/mtd0 | /opt/cu/apps/busybox1 nc 192.168.1.2 12345
复制代码
我这里每秒能传300-400KB的数据,整个传输过程大约需要13分钟。0 X4 r, Q8 x$ W9 @

: \8 Z* N9 N8 R

9 W: d, B" S; H) |最后留下文件:( L& L) h& l; x& l& ^
busybox for windows5 d0 F5 `! B  o- G" }

6 @) k1 ]# s* `2 k: |* u4 c
( G: x9 v) A% q* Z- [4 u5 {

/ \3 W- S$ ^, x$ i7 }, mbusybox for Arm 使用静态编译,文件较大,但无需另外的库支撑,直接使用8 ]' d8 T: B/ j& d/ z

/ f# k0 ~: f! ^& S
! C! \" J6 N! W5 p* [1 P
! }2 u( \$ P: f' _: }xz for Arm 使用静态编译,文件较大,但无需另外的库支撑,直接使用1 K( B1 C/ z1 _( |
  p' ]) P* v0 g1 o
) Y; K; g) Z- c% g  r5 X* n

本帖子中包含更多资源

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

×
发表于 2024-3-3 17:09:09 | 显示全部楼层
感谢!为技术网添砖加瓦!
发表于 2024-3-4 17:41:53 | 显示全部楼层
我去 有必要这么麻烦么,光猫都带tftp小型文件传输服务,在dev目录下 执行tftp -pl mtd0 你电脑的IP   在电脑上打开tftp服务端  想备份哪个都可以啊
 楼主| 发表于 2024-3-10 15:52:19 | 显示全部楼层
qq519948746 发表于 2024-3-4 17:41
! }% n) O# {5 j. p- H1 M: O我去 有必要这么麻烦么,光猫都带tftp小型文件传输服务,在dev目录下 执行tftp -pl mtd0 你电脑的IP   在电 ...

9 w: R2 p, c7 s5 R0 p受教了。这个办法好,测试了下每秒约800+KB/S,256MB需要约6分钟。+ N! \! `0 E: r2 l' |
发表于 2024-3-11 02:48:49 | 显示全部楼层
谢谢楼主分享
*滑块验证:
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|小黑屋|宽带技术网 |网站地图 粤公网安备44152102000001号

GMT+8, 2025-5-4 10:10 , Processed in 0.033964 second(s), 4 queries , Redis On.

Powered by Discuz! X3.5 Licensed

Copyright © 2001-2020, Tencent Cloud.

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