
我正在嘗試安裝Project Sandcastle(一個可以在iPhone 7上運行Android 10的專案)提供的Android nand映像。我正在嘗試安裝此磁碟映像,以便可以編輯可能位於此映像中的 boot.img 檔案。以下是有關該文件的一些資訊:
$ file nand
nand: DOS/MBR boot sector; partition 1 : ID=0xee, start-CHS (0x0,0,2), end-CHS (0x0,4,4), startsector 1, 255 sectors; partition 2 : ID=0x7, start-CHS (0x0,4,5), end-CHS (0x0,8,8), startsector 256, 256 sectors
$ sudo fdisk -lu nand
Disk nand: 3.5 GiB, 3269459968 bytes, 6385664 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000
Device Boot Start End Sectors Size Id Type
nand1 1 255 255 127.5K ee GPT
nand2 256 511 256 128K 7 HPFS/NTFS/exFAT
我嘗試在 macOS 中安裝它,但它要求檔案系統,而 ext4 和 msdos 不起作用。所以我製作了一個 Ubuntu live USB 並嘗試了這些命令並得到了以下輸出:
$ sudo mkdir /android
$ sudo mount -o loop,rw,offset=512 nand /android
mount: /android: wrong fs type, bad option, bad superblock on /dev/loop6, missing codepage or helper program, or other error.
所以我嘗試給出nand
一個文件擴展名,我想可能它沒有將其識別為文件,因為沒有擴展名。
$ mv nand android.image
$ sudo mount -o loop,rw,offset=512 android.image /android
NTFS signature is missing.
Failed to mount '/dev/loop6': Invalid argument
The device '/dev/loop6' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
我嘗試使用 offset=$((512*256)) 安裝另一個分割區,但出現了相同的輸出。我也嘗試過沒有偏移,但出現了相同的輸出。最後,我嘗試使用 ro 而不是 rw,但再次出現相同的輸出。我被困住了,我不知道下一步該做什麼。可以找到gzip壓縮後的nand鏡像在這個連結。我真的很感激任何人可以提供的任何幫助。
答案1
你的fdisk
輸出表明這是不是有效的分割表:nand2 僅佔用 128KB,這對於 NTFS 分割區來說根本不夠。我使用了 Wine 中運行的 7-zip(您可能可以使用本機可用的 p7zip)來開啟映像:它包含兩個「分區」和一個巨大的文件,該檔案是一個 ext4 分區。
不要問我如何找到這個 ext4 分割區的偏移量。您可以使用以下命令安裝它:
mount -o loop,offset=3145728,ro nand /mnt/sandcastle
它無法以讀寫方式掛載,因為 Android 10 實作了名為「shared_blocks」的新 ext4 功能,該功能尚未進入主線。