当前位置:   article > 正文

Android Q开关AVB remount分区,导致OTA升级super分区resize fail_android q 屏蔽super分区

android q 屏蔽super分区
  1. 问题平台:Android Q,无AB update,开启dynamic partition,机器专门做OTA升级压测,同一个OTA包在多个机器上升级,仅这台机器升级失败,其他机器升级没问题,且这台机器能正常开机和操作。
  2. 看OTA升级的log,异常为扩展system分区失败导致
[liblp]Partition vendor will resize from 0 bytes to 217198592 bytes
[liblp]Not enough free space to expand partition: system
Failed to resize partition system to size 1719984128.
script aborted: assert failed: update_dynamic_partitions(package_extract_file("dynamic_partitions_op_list"))
E:Error in @/cache/recovery/block.map (status 7)
  • 1
  • 2
  • 3
  • 4
  • 5
  1. 对比正常的log,分区大小是合法的,问题也就进一步证明与机器关联
[liblp]Partition vendor will resize from 0 bytes to 217198592 bytes
[liblp]Partition system will resize from 0 bytes to 1719984128 bytes
[liblp]Updated logical partition table at slot 0 on device /dev/block/by-name/super
  • 1
  • 2
  • 3
  1. 在异常和正常的机器上执行lpdump,确认异常的机器多了一个scratch分区
------------------------
  Name: scratch
  Group: default
  Attributes: none
  Extents:
    0 .. 559463 linear super 3639448
------------------------
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  1. 从Google信息看,adb remount时,就会创建这样的一个分区,
    https://source.android.google.cn/devices/tech/ota/dynamic_partitions/implement?hl=zh-cn#adb-remount

  2. 通过如下代码可以确认OTA不会删除scratch分区(属于default group),继而导致异常
    default分区的特殊处理

  3. 综上,操作上要复现问题,就是关avb,并adb remount_all之后操作system或vendor分区,填足够多的数据,然后在未关闭AVB的情况,直接进行OTA升级,就能够复现问题。

  4. 恢复的方法也就是如下,操作完毕之后,重新使能AVB就可。
    adb disable-verity -> adb remount(创建scratch分区用于存放文件)
    -> adb enable-verity(删除scratch分区,恢复系统镜像)

  5. 附上正常异常的lpdump命令执行结果

异常的
Metadata version: 10.0
Metadata size: 516 bytes
Metadata max size: 65536 bytes
Metadata slot count: 2
Partition table:
------------------------
  Name: scratch
  Group: default
  Attributes: none
  Extents:
    0 .. 559463 linear super 3639448
------------------------
  Name: vendor
  Group: group_oem
  Attributes: readonly
  Extents:
    0 .. 424215 linear super 2048
------------------------
  Name: system
  Group: group_oem
  Attributes: readonly
  Extents:
    0 .. 3185727 linear super 426264
------------------------
Block device table:
------------------------
  Partition name: super
  First sector: 2048
  Size: 2150629376 bytes
  Flags: none
------------------------
Group table:
------------------------
  Name: default
  Maximum size: 0 bytes
  Flags: none
------------------------
  Name: group_oem
  Maximum size: 2146435072 bytes
  Flags: none
------------------------

正常的
/cache # lpdump                                                         
Metadata version: 10.0
Metadata size: 440 bytes
Metadata max size: 65536 bytes
Metadata slot count: 2
Partition table:
------------------------
  Name: system
  Group: group_oem
  Attributes: readonly
  Extents:
    0 .. 3185727 linear super 2048
------------------------
  Name: vendor
  Group: group_oem
  Attributes: readonly
  Extents:
    0 .. 424215 linear super 3188736
------------------------
Block device table:
------------------------
  Partition name: super
  First sector: 2048
  Size: 2150629376 bytes
  Flags: none
------------------------
Group table:
------------------------
  Name: default
  Maximum size: 0 bytes
  Flags: none
------------------------
  Name: group_oem
  Maximum size: 2146435072 bytes
  Flags: none
------------------------
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/298880
推荐阅读
相关标签
  

闽ICP备14008679号