编程技术分享平台

网站首页 > 技术教程 正文

自制TWRP Recovery时Unable to find partition size for...问题

xnh888 2024-10-22 18:09:29 技术教程 21 ℃ 0 评论

自制TWRP recovery时出现以下问题

  • Primary block device '/dev/block/platform/... for mount point '/data' is not present
  • E:Unable to find partition size for '/boot'
  • 无法挂载'/system' (Invalid argument)

也也看不到文件内容:

原因是:系统没有找到分区信息导致挂载失败

解决是:根据原厂固件中的recovery.img对应位置中的数据修改/initrd和/initrd/etc/下的recovery.fstab,twrp.fstab等fstab文件

自制twrp rec过程

将原厂手机的recovery.img复制一份并命名为boot.img,与bootimg.exe放同一目录内:

解包:记住四个参数 base: 0x40078000,cmdline: "bootopt=64S3,32N2,64N2",page_size: 2048,padding_size=2048,下面打包时用

C:\tmp\makeRecovery\work4\oldRec>bootimg --unpack-bootimg
arguments: [bootimg file]
bootimg file: boot.img
output: kernel[.gz] ramdisk[.gz] second[.gz]
found nonstandard ramdisk_addr
found nonstandard second_addr
found nonstandard tags_addr
base: 0x40078000
ramdisk_addr: 0x44000000
second_addr: 0x40f00000
tags_addr: 0x4e000000
page_size: 2048
name: "1445293292"
cmdline: "bootopt=64S3,32N2,64N2"
padding_size=2048
arguments: [ramdisk file] [directory]
ramdisk file: ramdisk.gz
directory: initrd
output: cpiolist.txt
compress: True

产生如下新的文件:

bootinfo.txt和kernel.gz拷贝到新文件夹newRec中:

用上述相同方法解包第三方TWRP Recovery (找个与自己手机相同CPU的):

initrd和cpiolist.txt也拷贝到新文件夹newRec中:


重点要修改的文件:recovery.fstab,twrp.fstab,fstab.shamu,default.prop

修改recovery.fstab:这里是将msm_sdcc.1修改成mtk-msdc.0

用同样的方法修改twrp.fstab、fstab.shamu:

修改default.prop:

不成功时试着修改以下几个文件(根据原厂的来修改、追加):

打包:

C:\tmp\makeRecovery\work4\newRec>bootimg --repack-bootimg 0x40078000 "bootopt=64S3,32N2,64N2" 2048 2048
arguments: [cpiolist file]
cpiolist file: cpiolist.txt
output: ramdisk.cpio.gz
compress_level: 6
arguments: [base] [cmdline] [page_size] [padding_size]
kernel: kernel
ramdisk: ramdisk.cpio.gz
second:
dt_image:
base: 0x40078000
ramdisk_addr: 0x44000000
second_addr: 0x40f00000
tags_addr: 0x4e000000
name: 1445293292
cmdline: bootopt=64S3,32N2,64N2
page_size: 2048
padding_size: 2048
output: boot-new.img

生成一个新的文件:boot-new.img

将boot-new.img改名为recovery.img即可。

Tags:

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表