Jump to content

18 Aug: EFS auto backup script (for devs)


Guest PaulOBrien

Recommended Posts

I have now seen a number of cases of the EFS partition getting wiped / corrupted on the SGS II, leaving users with an effectively useless phone.

With this in mind, i've written a little init.d script for my ROM which backs up the EFS partition on boot if a backup does not already exist. A non intrusive safety net for users if you will. :)

The script just needs a suitable boot image that runs init.d, although it could easily be tacked onto the end of install-recovery.sh if that's not the case.

I'd love to encourage all developers to use this script for users' sake!

You can download the script here - http://cl.ly/2j0p0R3F07052m2T2u0e - but it's very simple, here's the code...

#!/system/bin/sh
# EFS auto backup script for Samsung Galaxy S II
# By @paulobrien - http://s2.MoDaCo.com

mount /dev/block/mmcblk0p11 /sdcard

if [ ! -f /sdcard/efs.autobackup.img ];
then
dd if=/dev/block/mmcblk0p1 of=/sdcard/efs.autobackup.img
fi

umount /sdcard[/code]

:)

Note the manual mount / umount of sdcard is necessary because this happens late in the boot process.

Cheers!

P

Link to comment
Share on other sites

Guest clivec

As a matter of interest Paul, if it became necessary to restore the efs partition, how do you go about doing it? Is it as described here:

http://forum.xda-developers.com/showthread.php?t=1085374

Or would it be different as yours is a .img file?

I've had a bit of a google about, found your thread on the xda devs site, but still no answer about restoring the image. Fastboot maybe?

Sorry if it's a noob question but i'm still learning about these things ;)

Link to comment
Share on other sites

Guest clivec

You'd 'dd' the image back.

P

Ah! Cool, so i'm assuming then that the phone would still be in some sort of bootable state then after corruption. Probably just sim and radio related issues i suppose.

Cheers. Good to know :)

Link to comment
Share on other sites

Ah! Cool, so i'm assuming then that the phone would still be in some sort of bootable state then after corruption. Probably just sim and radio related issues i suppose.

Cheers. Good to know :)

Correct! :)

P

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.