Android 11 无法remount问题

问题描述: 在Android 11开发的时候,想快速调试把单独编译好的模块push 到 /system 目录下,结果发现remount failed

C:>adb root
restarting adbd as root

C:>adb remount
Skipping /system for remount
Skipping /vendor for remount
Skipping /product for remount
No partitions to remount
remount failed

强行push 也是显示错误

 Z:framework> adb push .\framework.jar /system/
adb: error: failed to copy '.\framework.jar' to '/system/framework.jar': 
remote couldn't create file: Read-only file system
.\framework.jar: 1 file pushed, 0 skipped. 43.0 MB/s (29967488 bytes in 0.665s)

remote couldn't create file: Read-only file system


MTK解释: 原因是android P版本后google启用avb(Android Verified Boot)2.0,verified boot and DM-verity默认启用策略发生了变化。
DM-Verity behavior changes from vboot1.0 to avb2.0.
On vboot1.0, dm-verity is turned off on eng build and is enabled on userdebug/user build.
DM-verity could be disabled with adb (not fastboot) on userdebug build without unlocking device first.
DM-Verity could not be disabled on user build.
On avb2.0, dm-verity behavior are the same on all build variants.
It’s turned on by default and could only be disabled after device is unlocked.
dm-verity disable flag is moved from system image dm-verity metadata(vboot1.0) to vbmeta image(avb2.0), and you have two ways to disable it: adb and fastboot.

解决办法:

  • Android P + kernel-4.4 or kernel-3.18
download preloader with verified boot disabled which location is the same as scatter file //preloader_<PROJECT>_SBOOT_DIS.bin
adb root
adb disable-verity
adb reboot
adb root
adb remount
  • Android P + kernel-4.9 or after
1. download preloader with verified boot disabled which location is the same as scatter file. //preloader_<PROJECT>_SBOOT_DIS.bin
2.boot to Home Screen
3.go to setting -> system -> Developer options -> OEM unlocking
4.adb reboot bootloader
5.fastboot flashing unlock
6.press volume up key
7.fastboot reboot
8.adb root
9.adb disable-verity
10.adb reboot
11.adb root
12.adb remount

注意事项:

  1. 第一步需要先确认out目录有没有编译出preloader_<PROJECT>_SBOOT_DIS.bin 这个文件,是和下载时选择的Android_scatter.txt同级目录
    如果没有这个文件,那么需要先在系统里找到对应BoardConfig.mk

    	ifneq ($(wildcard vendor/mediatek/internal/sboot_disable),)
    	BOARD_BUILD_SBOOT_DIS:=yes
    	else
    	BOARD_BUILD_SBOOT_DIS:=no  // 把这个no 改为yes
    	endif
    

    把这个no 改为yes, 然后重编烧录开机,之后再进行后面的步骤。

  2. 第三步是要在开发者模式里找到OEM unlocking 并打开
    在这里插入图片描述

  3. 成功之后remount 是这样

    	Z:> adb remount
    	Using overlayfs for /system
    	Using overlayfs for /vendor
    	Using overlayfs for /product
    	Now reboot your device for settings to take effect
    	remount succeeded
    

总结: android 真的好难呀!

  • 7
    点赞
  • 23
    收藏
    觉得还不错? 一键收藏
  • 7
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值