Hi folks, especially the devs,
I am desperately trying to get e2fsck fix my data and system partitions before mount and also run fix_permissions on every boot.
Both filesystems may get corrupted on a crash or cold reset. (I know that system is mounted read only normally, but it can be remounted rw for tweaking purposes, you know?
The result of such a corruption are lots of force close popups and apps forgetting about their settings which many of us occassionally run into. (http://www.mobileread.com/forums/sho...d.php?t=164020 http://www.mobileread.com/forums/sho...d.php?t=164564
Anyways, I already got a working e2fsck binary and found out that the whole boot process is done by the /init binary running the /init.rc script.
Read here for details: http://www.kandroid.org/online-pdk/guide/bring_up.html
So, the first thing to be done is integrating e2fsck commands into init.rc. But this requires the e2fsck binary to be available at this stage. Any ideas?
The best thing would be a busybox binary with integrated e2fsck. But I haven't found one for ARM yet... The one I have is statically linked to EXT2FS library, got it from here: http://sites.google.com/site/juanjosec/android
But how to make it available during init? Integrate to uboot / initial ramdisk?
The second goal - running the fix_permissions script
- could be achieved by putting an exec call to /etc/install-recovery.sh, which is automatically called by /init.rc when the "on init" section is finished.
I tried many different ways to make install-recovery.sh run fix_permissions, but no success:
exec /system/bin/sh /system/bin/fix_permissions
The I tried to track this down by adding dummy echo commands to install-recovery.sh, but still nothing happens:
echo test > /mnt/sdcard/test.log
/system/bin/busybox echo test > /mnt/sdcard/test.log
write /mnt/sdcard/test.log test
None of these commands did create the logfile.