I’ve compiled aosp and then tried to repack my system.img using the following steps:
simg2img system.img system.raw
mount -o loop -t ext4 system.raw ./systemdir
make_ext4fs -s -l SIZE -a system custom-system.img ./systemdir
The size is computed from tune2fs -l ./system.raw (blocks * block size).
Then I flash this image with fastboot:
fastboot flash system ./custom-system.img
The kernel starts booting and then I see the following over the serial console:
…
[ 7.404572] init: Switching root to ‘/system’
[ 7.584143] EXT4-fs (sdd11): mounted filesystem without journal. Opts:
[ 7.764133] init: Skipped setting INIT_AVB_VERSION (not in recovery mode)
[ 7.771193] init: execv("/system/bin/init") failed: Permission denied
[ 7.788993] init: #00 pc 00000000002e4860 /init (deleted)
…
The board then reboots into fastboot mode. What am I doing wrong? I haven’t even modified the system image, just tried to repack it.