push文件到system分区,重启后文件会被自动恢复

文摘 Android Kernel 2020-02-4 阅读:1672

android.png


[DESCRIPTION]

客户反馈有些版本,push文件到system分区之后一旦重启,push的文件会被自动恢复.

[SOLUTION]

实际上这是因为开启了secure boot,从而触发system分区写保护,导致无法system写入。

从Code中可以看到如下内容:
/vendor/mediatek/proprietary/bootable/bootloader/lk/platform/mtxxxx/write_protect.c

int set_write_protect(void)
...
#ifdef MTK_SECURITY_SW_SUPPORT
  if (TRUE == seclib_sec_boot_enabled(TRUE))
   snprintf(wp_end, WRITE_PROTECT_PARTITION_NAME_SZ, "system");
  else
   snprintf(wp_end, WRITE_PROTECT_PARTITION_NAME_SZ, "tee2");
#else
   snprintf(wp_end, WRITE_PROTECT_PARTITION_NAME_SZ, "tee2");
#endif

如果想关闭secure boot,可以尝试如下方法:

MTK_SEC_USBDL=ATTR_SUSBDL_DISABLE
MTK_SEC_BOOT=ATTR_SBOOT_DISABLE


0条评论

© 2020 芯缘异码. Powered by Typecho