chriswoope / resign-android-image

Resign Android OS (esp. GrapheneOS) images with your signing keys and add ADB root and other modifications
MIT License
86 stars 6 forks source link

Support rebuilding filesystem images from scratch and probably make it the default #3

Open chriswoope opened 2 years ago

chriswoope commented 2 years ago

Currently resign-android-image does not rebuild filesystem images, but rather modifies the ext4 filesystem using a combination of tools.

This was done because the goal was to modify the upstream OTA/image as little as possible, but involves a lot of hackery due to the use of the ext4 shared_blocks feature, requires a lot of code including a verbose calculation of how much to enlarge the filesystem accounting for ext4 details and produces images that are larger than necessary and contain wasted space.

I think it may be better to support completely rebuilding the filesystem images, probably by completing the --rebuild option and recreating enough of target_files.zip so that sign_target_files_apk actually succeeds in building the images, and making that the default.

This would also remove the need to run the script as root as long as /tmp has enough space.