Support building rootfs images with 4096 byte sector sizes
On the Pixel 3 XL, the flash storage uses 4096 byte logical sectors, unlike all other devices, which uses 512 byte sectors. This prevents our root fs image from mounting, since Linux thinks partitions are 8 times bigger than they actually are.
To handle this scenario, I think there's two options.
- I could try changing the device's logical sector size. This may involve another device mapper layer that just switches sector sizes. I don't know how to do that currently.
or:
- just build this device's root FS with an MBR that uses 4096 byte logical sectors. This is the easier option, but would require changes in pmbootstrap.
For the second option, I believe we would need a new deviceinfo variable specifying the sector size, and modify pmb/install/partition.py to pass it to parted. How would I do that?
Finally, it's possible to test 4096 byte logical sectors with QEMU:
qemu-system-x86_64 --accel kvm -m 1G -cdrom alpine-extended-3.8.1-x86_64.iso \
-drive file=Empty512MB.img,if=none,id=mydisk,format=raw \
-device virtio-scsi-pci \
-device scsi-hd,bus=scsi.0,drive=mydisk,physical_block_size=4096,logical_block_size=4096
How would I modify the pmos QEMU target to pass this parameter to qemu for testing?