View Single Post
Old 01-25-2012, 08:37 AM   #1
uboot
Evangelist
uboot seems famous, but is in fact legendary.uboot seems famous, but is in fact legendary.uboot seems famous, but is in fact legendary.uboot seems famous, but is in fact legendary.uboot seems famous, but is in fact legendary.uboot seems famous, but is in fact legendary.uboot seems famous, but is in fact legendary.uboot seems famous, but is in fact legendary.uboot seems famous, but is in fact legendary.uboot seems famous, but is in fact legendary.uboot seems famous, but is in fact legendary.
 
Posts: 418
Karma: 75216
Join Date: Nov 2011
Location: old europe
Device: Kobo Mini, Sony PRS T1
Question HOWTO: e2fsck on init, fix_permissions afterwards

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:
Code:
/bin/fix_permissions
exec /system/bin/fix_permissions
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:
Code:
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.
uboot is offline   Reply With Quote