niceboygithub / AqaraM1SM2fw

Aqara Gateway M1S (ZHWG15LM) , P3(KTBL12LM), H1(QBCZWG11LM), M2 (ZHWG12LM) Firmwares
164 stars 27 forks source link

How to retrieve lost data partition files? #22

Closed z-x-f closed 2 years ago

z-x-f commented 2 years ago

Hello, I have used the wrong tool (gateway3utils.exe) to flash the firmware of M2, which resulted in the loss of data partition files. Is there any way to restore the data partition?

rezmus commented 2 years ago

if you didn't damaged mtd2 (factory) you can flash backup of someone else (best made after factory reset) and then factory reset hub (10x click). during factory reset only /data/musics/ is preserved (sounds). db is recreated from mtd2.

z-x-f commented 2 years ago

if you didn't damaged mtd2 (factory) you can flash backup of someone else (best made after factory reset) and then factory reset hub (10x click). during factory reset only /data/musics/ is preserved (sounds). db is recreated from mtd2.

Thank you for your answers, my mtd2 is not damaged. @niceboygithub Could you please provide me with a backup of the data partition? Thank you very much.

niceboygithub commented 2 years ago

I have uploaded the m2_musics.tar.gz.

You can use AqaraGateway.exe to flash the damaged parition then put the musics back as rezmus said.

z-x-f commented 2 years ago

@niceboygithub Thank you for your help. This is my M2 Hub startup log, what should I do to fix it?

m2.log
uart ok
strap pin:0x412b8ae2
enable spi-nand
ROM ver:v1.1, sig:455cc27, time:2016.01.04-18:42+0800, CPU(400 MHz), DDR2(533 MHz)
load efuse ok
init IP ok
rom_progress: 0x0600006d
load_data_from_storage(260): 0xbfe01540, 0x00000000, 0xbfd16f44 
load_data_from_spi_nand_flash(70): 0xbfe01540, 0x00000000, 0xbfe03e18 
check_image_header(72): h(69,72,61,6d), s(69,72,61,6d) 
img sig ok
rom_progress: 0x0c00006d
load_data_from_spi_nand_flash(81) 0x00000004 0x000024ba 
load_data_from_spi_nand_flash(86): 0xbfe01d40, 0x00000001, 0xbfe03e18 
load_data_from_spi_nand_flash(86): 0xbfe02540, 0x00000002, 0xbfe03e18 
load_data_from_spi_nand_flash(86): 0xbfe02d40, 0x00000003, 0xbfe03e18 
load_data_from_spi_nand_flash(86): 0xbfe03540, 0x00000004, 0xbfe03e18 
load_data_from_spi_nand_flash(90) read done (size:9402) 
chksum ok
rom_progress: 0x0e00006d
load img ok
rom_progress: 0x1000006d
jump 0xbfe01550

Booting...
SPI NAND clock not enable

SPI Nand ID=00efaa21
SPI Nand die chipsize=0x08000000 byte
SPI Nand dienum=1,
SPI Nand blocksize=0x00020000 byte,
SPI Nand pagesize=0x00000800 byte,
SPI Nand oobsize=0x00000040 byte,
[rtkn_scan_bbt, line 1812], RBA=51, this->RBA_PERCENT = 5,block_v2r_num=1024
[rtkn_scan_bbt, line 1822] block_v2r_num 00000400
[rtk_scan_v2r_bbt]:678,RBA=00000033,2=00000400,
[rtk_scan_v2r_bbt]:684,block_v2r_num=000003cd
INFO: Stored BBT in Die 0: block=8 , block_status_p1=0x000000bb
load bbt v2r table:0 page:512
[rtk_scan_v2r_bbt] have created v2r bbt table:0 on block 8, just loads it !!
check v2r bbt table:0 OK
[rtk_nand_scan_bbt, line 393] mem_page_num=1 bbt_page 704
INFO: Stored BBT in Die 0: block=11 , block_status_p1=0x000000bb
load bbt table:0 page:704
[rtk_nand_scan_bbt] have created bbt table:0 on block 11, just loads it !!
check bbt table:0 OK
[dump_BBT] Nand BBT Content
Congratulation!! No BBs in this Nand.
=>CPU Wake-up interrupt happen! GISR=09000084 

---Realtek RTL8197F boot code at 2020.07.08-18:00+0800 v3.4T-pre2.1 (993MHz)
Info: Load boot_info success!
== RTL8197 Aqara Gateway bootloader ==
boot_info: ver:0
kernel: newest:0, curr:1
rootfs: newest:0, curr:0
kernel[0]: sum:0x80b7, size:2233348, fail:3
      [1]: sum:0x8030, size:2233348, fail:0
rootfs[0]: sum:0xa7a4, size:9537540, fail:0
      [1]: sum:0x0000, size:9568256, fail:0
root_sum_check: off
watchdog_time: 0
boot_version: 1.0.0_0001
boot_magic: 0000917c
priv mode
Info: kernel 0 is invalid
Info: loading kernel 1 ...  Done
Info: checking kernel 1 ... Success
Info: select rootfs 0
cmdline:root=/dev/mtdblock5 console=ttyS0,38400
Info: booting...
Jump to image start=0x80a00000...
decompressing kernel:
Uncompressing Linux... done, booting the kernel.
done decompressing kernel.
start address: 0x804e4f10
[    0.000000] Linux version 3.10.90 (liaozhaobao@compilex64-ipg) (gcc version 4.9.4 20151028 (prerelease) (Realtek MSDK-4.9.4p1 Build 2648) ) #24 Mon Jun 28 18:29:54 CST 2021
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 00019385 (MIPS 24Kc)
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x00000000-0x03ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00000000-0x03ffffff]
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.000000] Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 4088
[    0.000000] Kernel command line: root=/dev/mtdblock5 console=ttyS0,38400
[    0.000000] PID hash table entries: 256 (order: -4, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 1, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 0, 16384 bytes)
[    0.000000] Writing ErrCtl register=00076c40
[    0.000000] Readback ErrCtl register=00076c40
[    0.000000] Memory: 57488k/65536k available (5043k kernel code, 8048k reserved, 1243k data, 240k init, 0k highmem)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:192
[    0.000000] Realtek GPIO IRQ init
[    0.000000] Calibrating delay loop... 660.68 BogoMIPS (lpj=3303424)
[    0.070000] pid_max: default: 32768 minimum: 301
[    0.080000] Mount-cache hash table entries: 2048
[    0.090000] NET: Registered protocol family 16
[    0.100000] <<<<>>>>
[    0.120000] Do MDIO_RESET
[    0.150000] 40MHz
[    0.510000] PCIE ->  Cannot LinkUP
[    0.520000] INFO: initializing USB devices ...
[    0.570000] enable port 0 two port enable
[    0.730000] patch new usb phy para for 40M OSC
[    1.270000] Realtek GPIO controller driver init
[    1.280000] INFO: initializing i2c devices ...
[    1.290000] INFO: registering sheipa spi device
[    1.310000] bio: create slab  at 0
[    1.320000] SCSI subsystem initialized
[    1.330000] INFO: sheipa spi driver register
[    1.340000] INFO: sheipa spi probe
[    1.350000] usbcore: registered new interface driver usbfs
[    1.360000] usbcore: registered new interface driver hub
[    1.370000] usbcore: registered new device driver usb
[    1.380000] Advanced Linux Sound Architecture Driver Initialized.
[    1.390000] cfg80211: Calling CRDA to update world regulatory domain
[    1.400000] Switching to clocksource MIPS
[    1.410000] NET: Registered protocol family 2
[    1.420000] TCP established hash table entries: 2048 (order: 0, 16384 bytes)
[    1.440000] TCP bind hash table entries: 2048 (order: -1, 8192 bytes)
[    1.460000] TCP: Hash tables configured (established 2048 bind 2048)
[    1.480000] TCP: reno registered
[    1.490000] UDP hash table entries: 1024 (order: 0, 16384 bytes)
[    1.510000] UDP-Lite hash table entries: 1024 (order: 0, 16384 bytes)
[    1.530000] NET: Registered protocol family 1
[    1.550000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    1.570000] exFAT: Version 1.2.9
[    1.580000] NTFS driver 2.1.30 [Flags: R/O].
[    1.590000] msgmni has been set to 112
[    1.610000] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
[    1.630000] io scheduler noop registered (default)
[    1.640000] pwm_probe
[    1.770000] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[    1.810000] console [ttyS0] enabled, bootconsole disabled7) is a 16550A
[    1.810000] console [ttyS0] enabled, bootconsole disabled
[    1.840000] serial8250: ttyS1 at MMIO 0x18147400 (irq = 5) is a 16550A
[    1.860000] serial8250: ttyS2 at MMIO 0x18147800 (irq = 47) is a 16550A
[    1.880000] Realtek GPIO Driver for Flash Reload Default
[    1.900000] id_chain value=efaa219f
[    1.910000] id_chain value=efaa219f
[    1.920000] NAND device: Manufacturer ID: 0xef, Chip ID: 0xaa (Unknown W25M01GV 1G SPI NAND), 128MiB, page size: 2048, OOB size: 64
[    1.950000] [rtkn_scan_bbt, line 1812], RBA=51, this->RBA_PERCENT = 5,block_v2r_num=1024
[    1.980000] [rtkn_scan_bbt, line 1822] block_v2r_num 400
[rtk_scan_v2r_bbt]:678,RBA=33,2=400,
[    2.000000] [rtk_scan_v2r_bbt]:684,block_v2r_num=3cd
[    2.020000] INFO: Stored BBT in Die 0: block=8 , block_status_p1=0xbb
[    2.040000] load bbt v2r table:0 page:512
[rtk_scan_v2r_bbt] have created v2r bbt table:0 on block 8, just loads it !!
check v2r bbt table:0 OK
[rtk_nand_scan_bbt, line 393] mem_page_num=1 bbt_page 704
[    2.110000] INFO: Stored BBT in Die 0: block=11 , block_status_p1=0xbb
[    2.130000] load bbt table:0 page:704
[rtk_nand_scan_bbt] have created bbt table:0 on block 11, just loads it !!
check bbt table:0 OK
[dump_BBT] Nand BBT Content
[    2.170000] Congratulation!! No BBs in this Nand.
[    2.190000] 9 rtkxxpart partitions found on MTD device rtk_nand
[    2.210000] Creating 9 MTD partitions on "rtk_nand":
[    2.220000] 0x000000000000-0x0000000a0000 : "bootloader"
[    2.240000] 0x0000000a0000-0x0000000e0000 : "boot_info"
[    2.250000] 0x0000000e0000-0x000000120000 : "factory"
[    2.270000] 0x000000120000-0x000000200000 : "bbt"
[    2.290000] 0x000000200000-0x000000500000 : "linux_1"
[    2.300000] 0x000000500000-0x000001500000 : "rootfs_1"
[    2.320000] 0x000001500000-0x000001800000 : "linux_2"
[    2.340000] 0x000001800000-0x000002800000 : "rootfs_2"
[    2.350000] 0x000002800000-0x000007320000 : "data"
[    2.370000] Realtek WLAN driver - version 1.7 (2015-10-30)(SVN:Unversioned directory)
[    2.390000] Adaptivity function - version 9.3.4
[    2.410000] Device Name = RTKWiFi0 
[    2.420000] VIF_NUM=9
[    2.430000] MACHAL_version_init
[    2.440000] RFE TYPE =0
[    2.440000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    2.460000] rtl819x-ehci rtl819x-ehci: Realtek rtl819x On-Chip EHCI Host Controller
[    2.490000] rtl819x-ehci rtl819x-ehci: new USB bus registered, assigned bus number 1
[    2.540000] rtl819x-ehci rtl819x-ehci: irq 21, io mem 0x18021000
[    2.570000] rtl819x-ehci rtl819x-ehci: USB 2.0 started, EHCI 1.00
[    2.580000] hub 1-0:1.0: USB hub found
[    2.600000] hub 1-0:1.0: 2 ports detected
[    2.610000] usbcore: registered new interface driver usb-storage
[    2.630000] lumi_btn_probe reset btn=7
[    2.640000] input: lumi_key as /devices/virtual/input/input0
[    2.660000] i2c /dev entries driver
[    2.670000] usbcore: registered new interface driver usbhid
[    2.690000] usbhid: USB HID core driver
[    2.700000] soc-audio soc-audio: ASoC: machine rtl819xd_rt5680 should use snd_soc_register_card()
[    2.730000] soc-audio soc-audio:  snd-soc-dummy-dai <-> rtl819x-iis mapping ok
[    2.750000] TCP: cubic registered
[    2.760000] NET: Registered protocol family 10
[    2.780000] sit: IPv6 over IPv4 tunneling driver
[    2.790000] NET: Registered protocol family 17
[    2.800000] Key type dns_resolver registered
[    2.820000] 
[    2.820000] Probing RTL819X NIC-kenel stack size order[0]...
[    3.510000] eth0 added. vid=9 Member port 0x110...
[    3.530000] eth1 added. vid=8 Member port 0x0...
[    3.550000] ALSA device list:
[    3.560000]   #0: rtl819xd_rt5680
[    3.570000] VFS: Mounted root (squashfs filesystem) readonly on device 31:5.
[    3.600000] Freeing unused kernel memory: 240K (80624000 - 80660000)
init started: BusyBox v1.22.1 (2021-11-12 21:21:55 CST)
Try attaching UBI(0,0) on MTD8 and mounting in [/data].
[    4.540000] UBI: attaching mtd8 to ubi0
[    6.440000] UBI: scanning is finished
[    6.490000] UBI warning: print_rsvd_warning: cannot reserve enough PEBs for bad PEB handling, reserved 18, need 20
[    6.520000] UBI: attached mtd8 (name "data", size 75 MiB) to ubi0
[    6.540000] UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[    6.560000] UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    6.580000] UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
[    6.600000] UBI: good PEBs: 601, bad PEBs: 0, corrupted PEBs: 0
[    6.620000] UBI: user volume: 1, internal volumes: 1, max. volumes count: 128
[    6.640000] UBI: max/mean erase counter: 4/2, WL threshold: 4096, image sequence number: 1269438207
[    6.670000] UBI: available PEBs: 0, total reserved PEBs: 601, PEBs reserved for bad PEB handling: 18
[    6.690000] UBI: background thread "ubi_bgt0d" started, PID 883
UBI device number 0, total 601 LEBs (76312576 bytes, 72.8 MiB), available 0 LEBs (0 bytes), LEB size 126976 bytes (124.0 KiB)
[    6.950000] UBIFS: parse sync
[    7.060000] UBIFS: background thread "ubifs_bgt0_0" started, PID 891
[    7.180000] UBIFS: recovery needed
[    7.190000] UBIFS error (pid 888): check_lpt_type: invalid type (15) in LPT node type 2
[    7.210000] CPU: 0 PID: 888 Comm: mount Not tainted 3.10.90 #24
[    7.230000] Stack : 00000000 00000000 00000000 00000000 8066924a 00000033 8378fdac c00f8000
      805d4a47 8055c5c8 00000378 837a81b0 80668604 c00f8000 8340588c 83405798
      00000003 804e69a8 00000000 80020338 00000006 83405798 8055dd10 8378fd1c
      00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
      00000000 00000000 00000000 00000000 00000000 00000000 00000000 8378fca8
      ...
[    7.340000] Call Trace:
[    7.340000] [<80007e04>] show_stack+0x64/0x7c
[    7.360000] [<8014d724>] check_lpt_type.constprop.16+0x60/0x68
[    7.370000] [<8014fbd0>] ubifs_lpt_init+0x320/0x55c
[    7.390000] [<8013539c>] ubifs_mount+0x42c/0x1740
[    7.400000] [<80099e04>] mount_fs+0x20/0xec
[    7.420000] [<800b1f1c>] vfs_kern_mount+0x64/0x104
[    7.430000] [<800b4824>] do_mount+0x1f4/0x9e8
[    7.440000] [<800b50ac>] SyS_mount+0x94/0xdc
[    7.460000] [<8000b4b0>] stack_done+0x20/0x44
[    7.470000] 
[    7.470000] UBIFS: background thread "ubifs_bgt0_0" stops
mount: mounting ubi0_0 on /data failed: Invalid [    7.500000] UBI: detaching mtd8 from ubi0
argument
Mount UBIFS failed!
[    7.520000] UBI: mtd8 is detached from ubi0
Try attaching UB[    7.550000] UBI: attaching mtd8 to ubi1
I(1,0) on MTD8 and mounting in [/data].
[    9.340000] UBI: scanning is finished
[    9.380000] UBI warning: print_rsvd_warning: cannot reserve enough PEBs for bad PEB handling, reserved 18, need 20
[    9.430000] UBI: attached mtd8 (name "data", size 75 MiB) to ubi1
[    9.450000] UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[    9.470000] UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    9.490000] UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
[    9.510000] UBI: good PEBs: 601, bad PEBs: 0, corrupted PEBs: 0
[    9.530000] UBI: user volume: 1, internal volumes: 1, max. volumes count: 128
[    9.550000] UBI: max/mean erase counter: 4/2, WL threshold: 4096, image sequence number: 1269438207
[    9.580000] UBI: available PEBs: 0, total reserved PEBs: 601, PEBs reserved for bad PEB handling: 18
[    9.610000] UBI: background thread "ubi_bgt1d" started, PID 908
UBI device number 1, total 601 LEBs (76312576 bytes, 72.8 MiB), available 0 LEBs (0 bytes), LEB size 126976 bytes (124.0 KiB)
[    9.840000] UBIFS: parse sync
[    9.950000] UBIFS: background thread "ubifs_bgt1_0" started, PID 913
[   10.070000] UBIFS: recovery needed
[   10.080000] UBIFS error (pid 910): check_lpt_type: invalid type (15) in LPT node type 2
[   10.100000] CPU: 0 PID: 910 Comm: mount Not tainted 3.10.90 #24
[   10.120000] Stack : 00000000 00000000 00000000 00000000 8066924a 00000033 83867dac c018c000
      805d4a47 8055c5c8 0000038e 837a9290 80668604 c018c000 8340588c 83405798
      00000003 804e69a8 00000000 80020338 00000006 83405798 8055dd10 83867d1c
      00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
      00000000 00000000 00000000 00000000 00000000 00000000 00000000 83867ca8
      ...
[   10.230000] Call Trace:
[   10.230000] [<80007e04>] show_stack+0x64/0x7c
[   10.250000] [<8014d724>] check_lpt_type.constprop.16+0x60/0x68
[   10.260000] [<8014fbd0>] ubifs_lpt_init+0x320/0x55c
[   10.280000] [<8013539c>] ubifs_mount+0x42c/0x1740
[   10.290000] [<80099e04>] mount_fs+0x20/0xec
[   10.310000] [<800b1f1c>] vfs_kern_mount+0x64/0x104
[   10.320000] [<800b4824>] do_mount+0x1f4/0x9e8
[   10.330000] [<800b50ac>] SyS_mount+0x94/0xdc
[   10.350000] [<8000b4b0>] stack_done+0x20/0x44
[   10.360000] 
[   10.360000] UBIFS: background thread "ubifs_bgt1_0" stops
mount: mounting ubi1_0 on /data failed: Invalid [   10.390000] UBI: detaching mtd8 from ubi1
argument
Mount UBIFS failed!
[   10.410000] UBI: mtd8 is detached from ubi1
Try attaching UB[   10.440000] UBI: attaching mtd8 to ubi2
I(2,0) on MTD8 and mounting in [/data].
[   12.230000] UBI: scanning is finished
[   12.270000] UBI warning: print_rsvd_warning: cannot reserve enough PEBs for bad PEB handling, reserved 18, need 20
[   12.310000] UBI: attached mtd8 (name "data", size 75 MiB) to ubi2
[   12.320000] UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[   12.340000] UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[   12.360000] UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
[   12.390000] UBI: good PEBs: 601, bad PEBs: 0, corrupted PEBs: 0
[   12.400000] UBI: user volume: 1, internal volumes: 1, max. volumes count: 128
[   12.420000] UBI: max/mean erase counter: 4/2, WL threshold: 4096, image sequence number: 1269438207
[   12.450000] UBI: available PEBs: 0, total reserved PEBs: 601, PEBs reserved for bad PEB handling: 18
[   12.480000] UBI: background thread "ubi_bgt2d" started, PID 927
UBI device number 2, total 601 LEBs (76312576 bytes, 72.8 MiB), available 0 LEBs (0 bytes), LEB size 126976 bytes (124.0 KiB)
[   12.730000] UBIFS: parse sync
[   12.840000] UBIFS: background thread "ubifs_bgt2_0" started, PID 935
[   12.960000] UBIFS: recovery needed
[   12.970000] UBIFS error (pid 932): check_lpt_type: invalid type (15) in LPT node type 2
[   12.990000] CPU: 0 PID: 932 Comm: mount Not tainted 3.10.90 #24
[   13.010000] Stack : 00000000 00000000 00000000 00000000 8066924a 00000033 837efdac c0220000
      805d4a47 8055c5c8 000003a4 837a81b0 80668604 c0220000 8340588c 83405798
      00000003 804e69a8 00000000 80020338 00000006 83405798 8055dd10 837efd1c
      00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
      00000000 00000000 00000000 00000000 00000000 00000000 00000000 837efca8
      ...
[   13.120000] Call Trace:
[   13.120000] [<80007e04>] show_stack+0x64/0x7c
[   13.140000] [<8014d724>] check_lpt_type.constprop.16+0x60/0x68
[   13.150000] [<8014fbd0>] ubifs_lpt_init+0x320/0x55c
[   13.170000] [<8013539c>] ubifs_mount+0x42c/0x1740
[   13.180000] [<80099e04>] mount_fs+0x20/0xec
[   13.200000] [<800b1f1c>] vfs_kern_mount+0x64/0x104
[   13.210000] [<800b4824>] do_mount+0x1f4/0x9e8
[   13.220000] [<800b50ac>] SyS_mount+0x94/0xdc
[   13.240000] [<8000b4b0>] stack_done+0x20/0x44
[   13.250000] 
[   13.250000] UBIFS: background thread "ubifs_bgt2_0" stops
mount: mounting ubi2_0 on /data failed: Invalid [   13.280000] UBI: detaching mtd8 from ubi2
argument
Mount UBIFS failed!
[   13.300000] UBI: mtd8 is detached from ubi2
Try attaching UB[   13.330000] UBI: attaching mtd8 to ubi3
I(3,0) on MTD8 and mounting in [/data].
[   15.120000] UBI: scanning is finished
[   15.160000] UBI warning: print_rsvd_warning: cannot reserve enough PEBs for bad PEB handling, reserved 18, need 20
[   15.210000] UBI: attached mtd8 (name "data", size 75 MiB) to ubi3
[   15.230000] UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[   15.250000] UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[   15.270000] UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
[   15.290000] UBI: good PEBs: 601, bad PEBs: 0, corrupted PEBs: 0
[   15.310000] UBI: user volume: 1, internal volumes: 1, max. volumes count: 128
[   15.330000] UBI: max/mean erase counter: 4/2, WL threshold: 4096, image sequence number: 1269438207
[   15.360000] UBI: available PEBs: 0, total reserved PEBs: 601, PEBs reserved for bad PEB handling: 18
[   15.390000] UBI: background thread "ubi_bgt3d" started, PID 952
UBI device number 3, total 601 LEBs (76312576 bytes, 72.8 MiB), available 0 LEBs (0 bytes), LEB size 126976 bytes (124.0 KiB)
[   15.620000] UBIFS: parse sync
[   15.730000] UBIFS: background thread "ubifs_bgt3_0" started, PID 957
[   15.850000] UBIFS: recovery needed
[   15.860000] UBIFS error (pid 954): check_lpt_type: invalid type (15) in LPT node type 2
[   15.880000] CPU: 0 PID: 954 Comm: mount Not tainted 3.10.90 #24
[   15.900000] Stack : 00000000 00000000 00000000 00000000 8066924a 00000033 8383fdac c02b4000
      805d4a47 8055c5c8 000003ba 837a8e58 80668604 c02b4000 8340588c 83405798
      00000003 804e69a8 00000000 80020338 00000006 83405798 8055dd10 8383fd1c
      00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
      00000000 00000000 00000000 00000000 00000000 00000000 00000000 8383fca8
      ...
[   16.010000] Call Trace:
[   16.010000] [<80007e04>] show_stack+0x64/0x7c
[   16.030000] [<8014d724>] check_lpt_type.constprop.16+0x60/0x68
[   16.040000] [<8014fbd0>] ubifs_lpt_init+0x320/0x55c
[   16.060000] [<8013539c>] ubifs_mount+0x42c/0x1740
[   16.070000] [<80099e04>] mount_fs+0x20/0xec
[   16.090000] [<800b1f1c>] vfs_kern_mount+0x64/0x104
[   16.100000] [<800b4824>] do_mount+0x1f4/0x9e8
[   16.110000] [<800b50ac>] SyS_mount+0x94/0xdc
[   16.130000] [<8000b4b0>] stack_done+0x20/0x44
[   16.140000] 
[   16.140000] UBIFS: background thread "ubifs_bgt3_0" stops
mount: mounting ubi3_0 on /data failed: Invalid [   16.170000] UBI: detaching mtd8 from ubi3
argument
Mount UBIFS failed!
[   16.190000] UBI: mtd8 is detached from ubi3
Try attaching UB[   16.220000] UBI: attaching mtd8 to ubi4
I(4,0) on MTD8 and mounting in [/data].
[   18.010000] UBI: scanning is finished
[   18.050000] UBI warning: print_rsvd_warning: cannot reserve enough PEBs for bad PEB handling, reserved 18, need 20
[   18.090000] UBI: attached mtd8 (name "data", size 75 MiB) to ubi4
[   18.110000] UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[   18.130000] UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[   18.150000] UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
[   18.170000] UBI: good PEBs: 601, bad PEBs: 0, corrupted PEBs: 0
[   18.190000] UBI: user volume: 1, internal volumes: 1, max. volumes count: 128
[   18.210000] UBI: max/mean erase counter: 4/2, WL threshold: 4096, image sequence number: 1269438207
[   18.240000] UBI: available PEBs: 0, total reserved PEBs: 601, PEBs reserved for bad PEB handling: 18
[   18.270000] UBI: background thread "ubi_bgt4d" started, PID 972
UBI device number 4, total 601 LEBs (76312576 bytes, 72.8 MiB), available 0 LEBs (0 bytes), LEB size 126976 bytes (124.0 KiB)
[   18.510000] UBIFS: parse sync
[   18.620000] UBIFS: background thread "ubifs_bgt4_0" started, PID 979
[   18.740000] UBIFS: recovery needed
[   18.750000] UBIFS error (pid 976): check_lpt_type: invalid type (15) in LPT node type 2
[   18.770000] CPU: 0 PID: 976 Comm: mount Not tainted 3.10.90 #24
[   18.790000] Stack : 00000000 00000000 00000000 00000000 8066924a 00000033 8378fdac c0348000
      805d4a47 8055c5c8 000003d0 837a81b0 80668604 c0348000 8340588c 83405798
      00000003 804e69a8 00000000 80020338 00000006 83405798 8055dd10 8378fd1c
      00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
      00000000 00000000 00000000 00000000 00000000 00000000 00000000 8378fca8
      ...
[   18.900000] Call Trace:
[   18.900000] [<80007e04>] show_stack+0x64/0x7c
[   18.920000] [<8014d724>] check_lpt_type.constprop.16+0x60/0x68
[   18.930000] [<8014fbd0>] ubifs_lpt_init+0x320/0x55c
[   18.950000] [<8013539c>] ubifs_mount+0x42c/0x1740
[   18.960000] [<80099e04>] mount_fs+0x20/0xec
[   18.980000] [<800b1f1c>] vfs_kern_mount+0x64/0x104
[   18.990000] [<800b4824>] do_mount+0x1f4/0x9e8
[   19.000000] [<800b50ac>] SyS_mount+0x94/0xdc
[   19.020000] [<8000b4b0>] stack_done+0x20/0x44
[   19.030000] 
[   19.030000] UBIFS: background thread "ubifs_bgt4_0" stops
mount: mounting ubi4_0 on /data failed: Invalid [   19.060000] UBI: detaching mtd8 from ubi4
argument
Mount UBIFS failed!
[   19.080000] UBI: mtd8 is detached from ubi4
Try attaching UB[   19.110000] UBI: attaching mtd8 to ubi5
I(5,0) on MTD8 and mounting in [/data].
[   20.900000] UBI: scanning is finished
[   20.940000] UBI warning: print_rsvd_warning: cannot reserve enough PEBs for bad PEB handling, reserved 18, need 20
[   20.980000] UBI: attached mtd8 (name "data", size 75 MiB) to ubi5
[   20.990000] UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[   21.010000] UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[   21.040000] UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
[   21.060000] UBI: good PEBs: 601, bad PEBs: 0, corrupted PEBs: 0
[   21.070000] UBI: user volume: 1, internal volumes: 1, max. volumes count: 128
[   21.090000] UBI: max/mean erase counter: 4/2, WL threshold: 4096, image sequence number: 1269438207
[   21.120000] UBI: available PEBs: 0, total reserved PEBs: 601, PEBs reserved for bad PEB handling: 18
[   21.150000] UBI: background thread "ubi_bgt5d" started, PID 993
UBI device number 5, total 601 LEBs (76312576 bytes, 72.8 MiB), available 0 LEBs (0 bytes), LEB size 126976 bytes (124.0 KiB)
[   21.400000] UBIFS: parse sync
[   21.510000] UBIFS: background thread "ubifs_bgt5_0" started, PID 1001
[   21.630000] UBIFS: recovery needed
[   21.640000] UBIFS error (pid 998): check_lpt_type: invalid type (15) in LPT node type 2
[   21.660000] CPU: 0 PID: 998 Comm: mount Not tainted 3.10.90 #24
[   21.680000] Stack : 00000000 00000000 00000000 00000000 8066924a 00000033 8378fdac c03dc000
      805d4a47 8055c5c8 000003e6 837a9b00 80668604 c03dc000 8340588c 83405798
      00000003 804e69a8 00000000 80020338 00000006 83405798 8055dd10 8378fd1c
      00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
      00000000 00000000 00000000 00000000 00000000 00000000 00000000 8378fca8
      ...
[   21.790000] Call Trace:
[   21.790000] [<80007e04>] show_stack+0x64/0x7c
[   21.810000] [<8014d724>] check_lpt_type.constprop.16+0x60/0x68
[   21.830000] [<8014fbd0>] ubifs_lpt_init+0x320/0x55c
[   21.840000] [<8013539c>] ubifs_mount+0x42c/0x1740
[   21.850000] [<80099e04>] mount_fs+0x20/0xec
[   21.870000] [<800b1f1c>] vfs_kern_mount+0x64/0x104
[   21.880000] [<800b4824>] do_mount+0x1f4/0x9e8
[   21.890000] [<800b50ac>] SyS_mount+0x94/0xdc
[   21.910000] [<8000b4b0>] stack_done+0x20/0x44
[   21.920000] 
[   21.920000] UBIFS: background thread "ubifs_bgt5_0" stops
mount: mounting ubi5_0 on /data failed: Invalid [   21.950000] UBI: detaching mtd8 from ubi5
argument
Mount UBIFS failed!
[   21.970000] UBI: mtd8 is detached from ubi5
[   22.120000] WlanSupportAbility = 0x3
[   22.140000] [ODM_software_init] 
[   22.140000] [97F] Bonding Type 97FS, PKG1
[   22.140000] [97F] RFE type 0 PHY paratemters: DEFAULT
[   22.140000] clock 40MHz
[   22.140000] load efuse ok
[   22.140000] rom_progress: 0x200006f
[   22.140000] rom_progress: 0x400006f
[   22.210000] [GetHwReg88XX][PHY_REG_PG_8197Fmp_Type0] size
[   22.230000] [GetHwReg88XX][PHY_REG_PG_8197Fmp_Type0]
[   22.440000] [GetHwReg88XX][rtl8197Ffw]
[   22.450000] [GetHwReg88XX][rtl8197Ffw size]
[   22.890000] [97F] Default BB Swing=30
cp: can't create '/data/musics/shadow': No such file or directory
cp: can't create '/data/musics/passwd': No such file or directory
mkdir: can't create directory '/data/storage': Read-only file system
fw_manager.sh revision: 2
pre-revision: 0
remove /data/lumi_fw
mkdir: can't create directory '/data/utils': Read-only file system
/bin/fw_manager.sh: line 1716: can't create /data/utils/fw_manager.revision: nonexistent directory
hostname: rlxlinux-0000
type: , model: 
Jan  1 00:00:27 mDNSResponder: mDNSResponder (Engineering Build) (Nov 12 2021 21:24:00) starting
Jan  1 00:00:27 mDNSResponder: Unable to parse DNS server list. Unicast DNS-SD unavailable
Jan  1 00:00:27 mDNSResponder: mDNSPlatformSourceAddrForDest: connect 1.1.1.1 failed errno 128 (Network is unreachable)
Jan  1 00:00:27 mDNSResponder: WARNING: mdnsd continuing as root because user "nobody" does not exist
factory_test bulid time:11:40:58 Nov 26 2021
get_factory_result=0
gobal_cmd_list size 4804
factory_dir:/data/factory!
mkdir: can't create directory '/data/factory': Read-only file system
ble uart port: 0
zigbee uart port: 1
ir i2c port: 2
homekit i2c port: 2
power measure i2c port: 2
factory udp_init!
connect localhost:1883
factory mqtt_init successfully!
on_connect result=0
killall: app_monitor.sh: no process killed
killall: ha_basis: no process killed
killall: ha_agent: no process killed
killall: ha_master: no process killed
killall: ha_driven: no process killed
killall: zigbee_agent: no process killed
killall: ha_ble: no process killed
killall: miio_client: no process killed
killall: miio_agent: no process killed
killall: miio_client_helper_nomqtt.sh: no process killed
killall: mha_master: no process killed
killall: mha_basis: no process killed
killall: mzigbee_agent: no process killed
killall: mijia_automation: no process killed
killall: homekitserver: no process killed
mzigbee_agent has been killed
mha_basis has been killed
mijia_automation has been killed
miio_client has been killed
miio_agent has been killed
miio_client_helper_nomqtt.sh has been killed
mha_master has been killed
homekitserver has been killed
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
killall: zigbee_agent: no process killed
to_response, 0
niceboygithub commented 2 years ago

You can have a try with the following commands

ubidetach /dev/ubi_ctrl -m 8
ubiformat /dev/mtd8 -y
ubiattach /dev/ubi_ctrl -m 8 -d 1
ubimkvol /dev/ubi1 -N ubifs1 -m
mount -t ubifs -o sync ubi1_0 /data

I am not 100% sure that they work.

z-x-f commented 2 years ago

It seems to work, but there are still errors.

Log
uart ok
strap pin:0x416b8ae2
enable spi-nand
ROM ver:v1.1, sig:455cc27, time:2016.01.04-18:42+0800, CPU(400 MHz), DDR2(533 MHz)
load efuse ok
init IP ok
rom_progress: 0x0600006d
load_data_from_storage(260): 0xbfe01540, 0x00000000, 0xbfd16f44 
load_data_from_spi_nand_flash(70): 0xbfe01540, 0x00000000, 0xbfe03e18 
check_image_header(72): h(69,72,61,6d), s(69,72,61,6d) 
img sig ok
rom_progress: 0x0c00006d
load_data_from_spi_nand_flash(81) 0x00000004 0x000024ba 
load_data_from_spi_nand_flash(86): 0xbfe01d40, 0x00000001, 0xbfe03e18 
load_data_from_spi_nand_flash(86): 0xbfe02540, 0x00000002, 0xbfe03e18 
load_data_from_spi_nand_flash(86): 0xbfe02d40, 0x00000003, 0xbfe03e18 
load_data_from_spi_nand_flash(86): 0xbfe03540, 0x00000004, 0xbfe03e18 
load_data_from_spi_nand_flash(90) read done (size:9402) 
chksum ok
rom_progress: 0x0e00006d
load img ok
rom_progress: 0x1000006d
jump 0xbfe01550

Booting...
SPI NAND clock not enable

SPI Nand ID=00efaa21
SPI Nand die chipsize=0x08000000 byte
SPI Nand dienum=1,
SPI Nand blocksize=0x00020000 byte,
SPI Nand pagesize=0x00000800 byte,
SPI Nand oobsize=0x00000040 byte,
[rtkn_scan_bbt, line 1812], RBA=51, this->RBA_PERCENT = 5,block_v2r_num=1024
[rtkn_scan_bbt, line 1822] block_v2r_num 00000400
[rtk_scan_v2r_bbt]:678,RBA=00000033,2=00000400,
[rtk_scan_v2r_bbt]:684,block_v2r_num=000003cd
INFO: Stored BBT in Die 0: block=8 , block_status_p1=0x000000bb
load bbt v2r table:0 page:512
[rtk_scan_v2r_bbt] have created v2r bbt table:0 on block 8, just loads it !!
check v2r bbt table:0 OK
[rtk_nand_scan_bbt, line 393] mem_page_num=1 bbt_page 704
INFO: Stored BBT in Die 0: block=11 , block_status_p1=0x000000bb
load bbt table:0 page:704
[rtk_nand_scan_bbt] have created bbt table:0 on block 11, just loads it !!
check bbt table:0 OK
[dump_BBT] Nand BBT Content
Congratulation!! No BBs in this Nand.
=>CPU Wake-up interrupt happen! GISR=09000084 
Reboot Result from Watchdog Timeout!

---Realtek RTL8197F boot code at 2020.07.08-18:00+0800 v3.4T-pre2.1 (993MHz)
Info: Load boot_info success!
== RTL8197 Aqara Gateway bootloader ==
boot_info: ver:0
kernel: newest:0, curr:1
rootfs: newest:0, curr:0
kernel[0]: sum:0x80b7, size:2233348, fail:3
      [1]: sum:0x8030, size:2233348, fail:0
rootfs[0]: sum:0xa7a4, size:9537540, fail:0
      [1]: sum:0x0000, size:9568256, fail:0
root_sum_check: off
watchdog_time: 0
boot_version: 1.0.0_0001
boot_magic: 0000917c
priv mode
Info: kernel 0 is invalid
Info: loading kernel 1 ...  Done
Info: checking kernel 1 ... Success
Info: select rootfs 0
cmdline:root=/dev/mtdblock5 console=ttyS0,38400
Info: booting...
Jump to image start=0x80a00000...
decompressing kernel:
Uncompressing Linux... done, booting the kernel.
done decompressing kernel.
start address: 0x804e4f10
[    0.000000] Linux version 3.10.90 (liaozhaobao@compilex64-ipg) (gcc version 4.9.4 20151028 (prerelease) (Realtek MSDK-4.9.4p1 Build 2648) ) #24 Mon Jun 28 18:29:54 CST 2021
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 00019385 (MIPS 24Kc)
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x00000000-0x03ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00000000-0x03ffffff]
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
[    0.000000] Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 4088
[    0.000000] Kernel command line: root=/dev/mtdblock5 console=ttyS0,38400
[    0.000000] PID hash table entries: 256 (order: -4, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 1, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 0, 16384 bytes)
[    0.000000] Writing ErrCtl register=00026c40
[    0.000000] Readback ErrCtl register=00026c40
[    0.000000] Memory: 57488k/65536k available (5043k kernel code, 8048k reserved, 1243k data, 240k init, 0k highmem)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:192
[    0.000000] Realtek GPIO IRQ init
[    0.000000] Calibrating delay loop... 660.68 BogoMIPS (lpj=3303424)
[    0.070000] pid_max: default: 32768 minimum: 301
[    0.080000] Mount-cache hash table entries: 2048
[    0.090000] NET: Registered protocol family 16
[    0.100000] <<<<>>>>
[    0.120000] Do MDIO_RESET
[    0.150000] 40MHz
[    0.510000] PCIE ->  Cannot LinkUP
[    0.520000] INFO: initializing USB devices ...
[    0.570000] enable port 0 two port enable
[    0.730000] patch new usb phy para for 40M OSC
[    1.270000] Realtek GPIO controller driver init
[    1.280000] INFO: initializing i2c devices ...
[    1.290000] INFO: registering sheipa spi device
[    1.310000] bio: create slab  at 0
[    1.320000] SCSI subsystem initialized
[    1.330000] INFO: sheipa spi driver register
[    1.340000] INFO: sheipa spi probe
[    1.350000] usbcore: registered new interface driver usbfs
[    1.360000] usbcore: registered new interface driver hub
[    1.370000] usbcore: registered new device driver usb
[    1.380000] Advanced Linux Sound Architecture Driver Initialized.
[    1.390000] cfg80211: Calling CRDA to update world regulatory domain
[    1.400000] Switching to clocksource MIPS
[    1.410000] NET: Registered protocol family 2
[    1.420000] TCP established hash table entries: 2048 (order: 0, 16384 bytes)
[    1.440000] TCP bind hash table entries: 2048 (order: -1, 8192 bytes)
[    1.460000] TCP: Hash tables configured (established 2048 bind 2048)
[    1.480000] TCP: reno registered
[    1.490000] UDP hash table entries: 1024 (order: 0, 16384 bytes)
[    1.510000] UDP-Lite hash table entries: 1024 (order: 0, 16384 bytes)
[    1.530000] NET: Registered protocol family 1
[    1.550000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    1.570000] exFAT: Version 1.2.9
[    1.580000] NTFS driver 2.1.30 [Flags: R/O].
[    1.590000] msgmni has been set to 112
[    1.610000] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
[    1.630000] io scheduler noop registered (default)
[    1.640000] pwm_probe
[    1.770000] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[    1.790000] serial8250: ttyS0 at MMIO 0x18147000 (irq = 17) is a 16550A
[    1.810000] console [ttyS0] enabled, bootconsole disabled
[    1.810000] console [ttyS0] enabled, bootconsole disabled
[    1.840000] serial8250: ttyS1 at MMIO 0x18147400 (irq = 5) is a 16550A
[    1.860000] serial8250: ttyS2 at MMIO 0x18147800 (irq = 47) is a 16550A
[    1.880000] Realtek GPIO Driver for Flash Reload Default
[    1.900000] id_chain value=efaa219f
[    1.910000] id_chain value=efaa219f
[    1.920000] NAND device: Manufacturer ID: 0xef, Chip ID: 0xaa (Unknown W25M01GV 1G SPI NAND), 128MiB, page size: 2048, OOB size: 64
[    1.950000] [rtkn_scan_bbt, line 1812], RBA=51, this->RBA_PERCENT = 5,block_v2r_num=1024
[    1.980000] [rtkn_scan_bbt, line 1822] block_v2r_num 400
[rtk_scan_v2r_bbt]:678,RBA=33,2=400,
[    2.000000] [rtk_scan_v2r_bbt]:684,block_v2r_num=3cd
[    2.020000] INFO: Stored BBT in Die 0: block=8 , block_status_p1=0xbb
[    2.040000] load bbt v2r table:0 page:512
[rtk_scan_v2r_bbt] have created v2r bbt table:0 on block 8, just loads it !!
check v2r bbt table:0 OK
[rtk_nand_scan_bbt, line 393] mem_page_num=1 bbt_page 704
[    2.110000] INFO: Stored BBT in Die 0: block=11 , block_status_p1=0xbb
[    2.130000] load bbt table:0 page:704
[rtk_nand_scan_bbt] have created bbt table:0 on block 11, just loads it !!
check bbt table:0 OK
[dump_BBT] Nand BBT Content
[    2.170000] Congratulation!! No BBs in this Nand.
[    2.190000] 9 rtkxxpart partitions found on MTD device rtk_nand
[    2.210000] Creating 9 MTD partitions on "rtk_nand":
[    2.220000] 0x000000000000-0x0000000a0000 : "bootloader"
[    2.240000] 0x0000000a0000-0x0000000e0000 : "boot_info"
[    2.250000] 0x0000000e0000-0x000000120000 : "factory"
[    2.270000] 0x000000120000-0x000000200000 : "bbt"
[    2.290000] 0x000000200000-0x000000500000 : "linux_1"
[    2.300000] 0x000000500000-0x000001500000 : "rootfs_1"
[    2.320000] 0x000001500000-0x000001800000 : "linux_2"
[    2.340000] 0x000001800000-0x000002800000 : "rootfs_2"
[    2.350000] 0x000002800000-0x000007320000 : "data"
[    2.370000] Realtek WLAN driver - version 1.7 (2015-10-30)(SVN:Unversioned directory)
[    2.390000] Adaptivity function - version 9.3.4
[    2.410000] Device Name = RTKWiFi0 
[    2.420000] VIF_NUM=9
[    2.430000] MACHAL_version_init
[    2.440000] RFE TYPE =0
[    2.440000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    2.460000] rtl819x-ehci rtl819x-ehci: Realtek rtl819x On-Chip EHCI Host Controller
[    2.490000] rtl819x-ehci rtl819x-ehci: new USB bus registered, assigned bus number 1
[    2.540000] rtl819x-ehci rtl819x-ehci: irq 21, io mem 0x18021000
[    2.570000] rtl819x-ehci rtl819x-ehci: USB 2.0 started, EHCI 1.00
[    2.580000] hub 1-0:1.0: USB hub found
[    2.600000] hub 1-0:1.0: 2 ports detected
[    2.610000] usbcore: registered new interface driver usb-storage
[    2.630000] lumi_btn_probe reset btn=7
[    2.640000] input: lumi_key as /devices/virtual/input/input0
[    2.660000] i2c /dev entries driver
[    2.670000] usbcore: registered new interface driver usbhid
[    2.690000] usbhid: USB HID core driver
[    2.700000] soc-audio soc-audio: ASoC: machine rtl819xd_rt5680 should use snd_soc_register_card()
[    2.730000] soc-audio soc-audio:  snd-soc-dummy-dai <-> rtl819x-iis mapping ok
[    2.750000] TCP: cubic registered
[    2.760000] NET: Registered protocol family 10
[    2.780000] sit: IPv6 over IPv4 tunneling driver
[    2.790000] NET: Registered protocol family 17
[    2.800000] Key type dns_resolver registered
[    2.820000] 
[    2.820000] Probing RTL819X NIC-kenel stack size order[0]...
[    3.510000] eth0 added. vid=9 Member port 0x110...
[    3.530000] eth1 added. vid=8 Member port 0x0...
[    3.550000] ALSA device list:
[    3.560000]   #0: rtl819xd_rt5680
[    3.570000] VFS: Mounted root (squashfs filesystem) readonly on device 31:5.
[    3.600000] Freeing unused kernel memory: 240K (80624000 - 80660000)
init started: BusyBox v1.22.1 (2021-11-12 21:21:55 CST)
Try attaching UBI(0,0) on MTD8 and mounting in [/data].
[    4.540000] UBI: attaching mtd8 to ubi0
[    6.450000] UBI: scanning is finished
[    6.500000] UBI: attached mtd8 (name "data", size 75 MiB) to ubi0
[    6.520000] UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[    6.540000] UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    6.560000] UBI: VID header offset: 2048 (aligned 2048), data offset: 4096
[    6.580000] UBI: good PEBs: 601, bad PEBs: 0, corrupted PEBs: 0
[    6.600000] UBI: user volume: 1, internal volumes: 1, max. volumes count: 128
[    6.620000] UBI: max/mean erase counter: 5/3, WL threshold: 4096, image sequence number: 2108438657
[    6.650000] UBI: available PEBs: 0, total reserved PEBs: 601, PEBs reserved for bad PEB handling: 20
[    6.670000] UBI: background thread "ubi_bgt0d" started, PID 883
UBI device number 0, total 601 LEBs (76312576 bytes, 72.8 MiB), available 0 LEBs (0 bytes), LEB size 126976 bytes (124.0 KiB)
[    6.940000] UBIFS: parse sync
[    7.040000] UBIFS: background thread "ubifs_bgt0_0" started, PID 891
[    7.160000] UBIFS: recovery needed
[    7.640000] UBIFS: recovery completed
[    7.650000] UBIFS: mounted UBI device 0, volume 0, name "ubifs1"
[    7.670000] UBIFS: LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[    7.700000] UBIFS: FS size: 71995392 bytes (68 MiB, 567 LEBs), journal size 3555328 bytes (3 MiB, 28 LEBs)
[    7.720000] UBIFS: reserved for root: 3400519 bytes (3320 KiB)
[    7.740000] UBIFS: media format: w4/r0 (latest is w4/r0), UUID A41C58B3-46B9-4734-A0C4-6ABC785D481F, small LPT model
Mount UBIFS successfully!
[    7.920000] WlanSupportAbility = 0x3
[    7.930000] [ODM_software_init] 
[    7.930000] [97F] Bonding Type 97FS, PKG1
[    7.930000] [97F] RFE type 0 PHY paratemters: DEFAULT
[    7.930000] clock 40MHz
[    7.930000] load efuse ok
[    7.930000] rom_progress: 0x200006f
[    7.930000] rom_progress: 0x400006f
[    8.000000] [GetHwReg88XX][PHY_REG_PG_8197Fmp_Type0] size
[    8.020000] [GetHwReg88XX][PHY_REG_PG_8197Fmp_Type0]
[    8.240000] [GetHwReg88XX][rtl8197Ffw]
[    8.250000] [GetHwReg88XX][rtl8197Ffw size]
[    8.680000] [97F] Default BB Swing=30
fw_manager.sh revision: 2
pre-revision: 2

hostname: Aqara-Hub-M2-0000
type: lumi.gateway.iragl5, model: AH_M2_BLE
Jan  1 00:00:13 mDNSResponder: mDNSResponder (Engineering Build) (Nov 12 2021 21:24:00) starting
Jan  1 00:00:13 mDNSResponder: Unable to parse DNS server list. Unicast DNS-SD unavailable
Jan  1 00:00:13 mDNSResponder: mDNSPlatformSourceAddrForDest: connect 1.1.1.1 failed errno 128 (Network is unreachable)
Jan  1 00:00:13 mDNSResponder: WARNING: mdnsd continuing as root because user "nobody" does not exist
factory_test bulid time:11:40:58 Nov 26 2021
get_factory_result=0
gobal_cmd_list size 4804
factory_dir:/data/factory!
ble uart port: 0
zigbee uart port: 1
ir i2c port: 2
homekit i2c port: 2
power measure i2c port: 2
factory udp_init!
connect localhost:1883
factory mqtt_init successfully!
on_connect result=0
killall: app_monitor.sh: no process killed
killall: ha_basis: no process killed
killall: ha_agent: no process killed
killall: ha_master: no process killed
killall: ha_driven: no process killed
killall: zigbee_agent: no process killed
killall: ha_ble: no process killed
killall: miio_client: no process killed
killall: miio_agent: no process killed
killall: miio_client_helper_nomqtt.sh: no process killed
killall: mha_master: no process killed
killall: mha_basis: no process killed
killall: mzigbee_agent: no process killed
killall: mijia_automation: no process killed
killall: homekitserver: no process killed
mzigbee_agent has been killed
mha_basis has been killed
mijia_automation has been killed
miio_client has been killed
miio_agent has been killed
miio_client_helper_nomqtt.sh has been killed
mha_master has been killed
homekitserver has been killed
sh: write error: Device or resource busy
sh: write error: Device or resource busy
sh: write error: Device or resource busy
killall: zigbee_agent: no process killed
Input cmd:cat: can't open '/data/factory/zigbee_device_lumi.0': No such file or directory
to_response, 1
udp send :[{"wifi_mac":"00E04C818686","cmd":"device_report","did":"lumi.0","model":"unknow","params":[{"res_name":"8.0.2021","value":""}]}]
udp send encrypt data len:[128]
udp send failed! ret = -1
to_response, 0
{"wifi_mac":"00E04C818686","cmd":"device_report","did":"lumi.0","model":"unknow","params":[{"res_name":"8.0.2021","value":""}]}
cat: can't open '/data/factory/zigbee_device_lumi.0': No such file or directory
to_response, 1
udp send :[{"wifi_mac":"00E04C818686","cmd":"device_report","did":"lumi.0","model":"unknow","params":[{"res_name":"8.0.2108","value":"1"}]}]
udp send encrypt data len:[144]
udp send failed! ret = -1
to_response, 0
{"wifi_mac":"00E04C818686","cmd":"device_report","did":"lumi.0","model":"unknow","params":[{"res_name":"8.0.2108","value":"1"}]}
cat: can't open '/data/factory/zigbee_device_lumi.0': No such file or directory
to_response, 1
udp send :[{"wifi_mac":"00E04C818686","cmd":"device_report","did":"lumi.0","model":"unknow","params":[{"res_name":"8.0.2155","value":"1"}]}]
udp send encrypt data len:[144]
udp send failed! ret = -1
to_response, 0
{"wifi_mac":"00E04C818686","cmd":"device_report","did":"lumi.0","model":"unknow","params":[{"res_name":"8.0.2155","value":"1"}]}
zigbee mac:54ef44100004d56c
to_response, 0
{"wifi_mac":"00E04C818686","set_zigbee_channel":"ok"}
cat: can't open '/data/factory/zigbee_device_lumi.0': No such file or directory
to_response, 1
udp send :[{"wifi_mac":"00E04C818686","cmd":"device_report","did":"lumi.0","model":"unknow","params":[{"res_name":"8.0.2157","value":"24388"}]}]
udp send encrypt data len:[144]
udp send failed! ret = -1
to_response, 0
{"wifi_mac":"00E04C818686","cmd":"device_report","did":"lumi.0","model":"unknow","params":[{"res_name":"8.0.2157","value":"24388"}]}
cat: can't open '/data/factory/zigbee_device_lumi.0': No such file or directory
to_response, 1
udp send :[{"wifi_mac":"00E04C818686","cmd":"device_report","did":"lumi.0","model":"unknow","params":[{"res_name":"8.0.2021","value":""}]}]
udp send encrypt data len:[128]
udp send failed! ret = -1
to_response, 0
{"wifi_mac":"00E04C818686","cmd":"device_report","did":"lumi.0","model":"unknow","params":[{"res_name":"8.0.2021","value":""}]}
cat: can't open '/data/factory/zigbee_device_lumi.0': No such file or directory
to_response, 1
udp send :[{"wifi_mac":"00E04C818686","cmd":"device_report","did":"lumi.0","model":"unknow","params":[{"res_name":"8.0.2021","value":""}]}]
udp send encrypt data len:[128]
udp send failed! ret = -1
to_response, 0
{"wifi_mac":"00E04C818686","cmd":"device_report","did":"lumi.0","model":"unknow","params":[{"res_name":"8.0.2021","value":""}]}
niceboygithub commented 2 years ago

it is in factory mode, you need to let it exit factory mode

get_factory_result = 0

first, enter "exit" (I did remember the right command, you can enter "?" or "help" to query)

setprop persist.sys.factory_result true

please backup your factory data and properties, It is important.

dd if=/dev/mtd2 of=/data/factory.bin
getprop
getprop persist.sys.hap_verifier
getprop persist.app.peerids_0
getprop persist.sys.coap_key

then write back to factory data partition.

this command is dangerous if you properties are incorrected. Suggest you enter "getprop" to get all properties then save them in case.

factory_data force_init

But I guest the values of factory data partition may corrupted.

z-x-f commented 2 years ago

Wow, it was fixed, thank you so much.

~~There is another question, why does my kernel0 always fail:3 Even if the sum of kernel 0 and kernel 1 is the same, kernel 1 is fine, but kernel 0 cannot be used. Update:Has been fixed by m2_update.sh~~