-
Notifications
You must be signed in to change notification settings - Fork 6
Home
Original NAND memory of the tablet is divided into 9 partitions:
- nanda - vfat file system, boot partition
- nandb - parameters for u-boot
- nandc - Linux kernel + initrd, created by mkbootimg - for normal boot
- nandd - ext4 file system, mounted as /system on Android
- nande - ext4 file system, mounted as /data
- nandf - parameters for reboot
- nandg - Linux kernel + initrd, created by mkbootimg - for recovery boot
- nandh - ext4 file system, mounted as /cache
- nandi - vfat file system, mounted as /mnt/sdcard
The tablet has two partitions with kernel image and initrd: /dev/block/nandc used for normal boot and /dev/block/nandg used for recovery. The partitions contain images in Android fastboot format. Android mkbootimg tool is used to build such images.
The fastboot_img_dump tool may be used to dump information included in the fastboot image header. Optionally the tool extracts kernel image and initrd from the file.
Suppose nandc file contains tablet nandc partition contents. Invoke:
$ fastboot_img_dump nandc
The following output appears:
kernel size (bytes): 8122052
kernel addr: 0x40008000
ramdisk size (bytes): 514918
ramdisk addr: 0x41000000
second size: 0
second addr: 0x40f00000
tags addr: 0x40000100
page size: 2048
unused1: 0
unused2: 0
product name:
cmdline: console=ttyS0,115200 rw init=/init loglevel=8
It means: kernel image is 8122052 bytes long. It will be loaded by boot loader (u-boot) into memory at physical address 0x40008000. Ramdisk image (intrd) is 514918 bytes long and will be loaded by u-boot at address 0x41000000. Kernel command line will be set to value specified by cmdline.
Kernel image and ramdisk maybe extracted using the fastboot_img_dump tool with -e option:
$ fastboot_img_dump -e nandc
This creates two files:
- bImage_nandc with kernel image
- initrd_nandc with ramdisk image
Ramdisk image is usual cpio archive packed with gzip. It may be unpacked using:
$ mkdir initrd_nandc.d
$ cd initrd_nandc.d
$ gzip -d -c ../initrd_nandc | cpio -i
Then packed back as follows:
$ find . | cpio -R 0:0 -o -H newc | gzip >../initrd\_nandc\_new
The fastboot image may be built back with the command:
$ cd ..
$ mkbootimg --kernel bImage_nandc --ramdisk initrd_nandc_new --cmdline "console=ttyS0,115200 rw init=/init loglevel=8" --base 0x40000000 -o nandc_new