[HOWTO] Creating custom SBF firmware

Search This thread

Simplestas

Senior Member
Sep 2, 2010
143
112
With Epsylon3 brilliant work, a new idea of flashing custom firmwares came to surface, allowing custom /system partition to be flashed directly from RSD Lite! This way you don't need to flash fixed SBFs and waste time with rooting and recovery install in case of system screw-up.

What you need:
1) MotoAndroidDepacker. With it, unpack sbf of the firmware you use as base.
2) Leave CG35(boot) and CG61(devtree) partition files, delete other smgs. Other files are not that important. You can delete all partition files if you're making backup for yourself...
3) Replace CG39(system) with your system dump:
adb shell:
su
dd if=/dev/block/system of=/sdcard/CG39.smg
copy CG39.smg from sd card to your firmware folder.
4) Compile sbf with MotoAndroidDepacker.
5) Flash your sbf in case of failure.

MAJOR CAVEAT: This sbf will work ONLY on devices with have same full SBF version applied last as your device. I.e. if you have flashed 3.4.2-107 and then upgraded it with nandroid to 3.4.2-177, the sbf you created from your system dump will work only for devices which flashed still 3.4.2-107 sbf last. To install such (custom) sbf, one would need to flash full 3.4.2-107 sbf first.

Technical: this is possible because of bug/feature in flashing process: system signature partiton is not checked if phone signature is already present. Phone signature is generated when flashing full genuine sbf and is verified aganist copy in sp partition and obviously differs for each firmware. It is stored at the end of the system partition.
 
Last edited:

Simplestas

Senior Member
Sep 2, 2010
143
112
You can make a backup for yourself and flash it again all you want until you flash another full motorola sbf. Don't forget to make data backups as well, this method can't replace nandroid / titanium!
 

dedraks

Senior Member
Nov 1, 2010
623
341
Belo Horizonte
www.in4byte.com
Interesting...
So I can flash my base sbf, integrate call recording, 720p playback, wvga recording, root, swype on my language and other mods and create a new sbf only to apply these mods.
It will be usefull.... :D
 

chaihg

Senior Member
Nov 15, 2010
496
53
Oh great all of us asked this question when this section began in xda. So essentially we can make an sbf out of our phones and keep it and not worry about any nandroid backups.
This is a great discovery, thanks a ton.

Cheers
 

michka

Senior Member
Oct 7, 2010
82
1
So would it be possible creating custom bootmenus as these are updated by sbf's too?
 

sunoldman

Senior Member
Jan 20, 2011
144
34
If your current system contain boot menu. The custom sbf also, it is identical with the current system.
 

Epsylon3

Senior Member
Jan 25, 2008
1,177
4,310
Geneva
tanguy.forumdoandroid.com
i think you can create a Full SBF with all original partitions and your "signed" CG39

I think it is not a bug... the thing is : i'm not sure sbf can work on other devices ... but anyway... it can be really usefull to recover device or to create a full backup with the good kernel made for the /system and /devtree

mbr and ebr are needed too, if the partition table has changes, you will have problems..
 
Last edited:
  • Like
Reactions: srk_srinivas

sunoldman

Senior Member
Jan 20, 2011
144
34
So the question is whether the signature is related to the specific part of every device, or it is universal as official sbf. Need to be verified .
 

AgentSmith

Senior Member
Feb 22, 2006
764
175
Great news! But why are Android systems so complicated when it comes to flashing and banking up? I mean, with computers it's easy. You make an image of the system partition and you're done. Restoring is as simple as writing the backup back to the partition. So, why is it so hard to just make an entire nand backup that we can simply write back to go to a working state after failure?

Sent from my MB525 using Tapatalk
 

sunoldman

Senior Member
Jan 20, 2011
144
34
I made a custom sbf with nightly build in it . Then wipe and flash it, stuck at M logo. Bootmenu works, but it seems that it can't mount some partition , it's the same symptom when wipe in stock recovery in cm7.
Does it really need to flash a full sbf before the custom sbf ?
 

Simplestas

Senior Member
Sep 2, 2010
143
112
Well you forgot RAMDLD... One CG39 is enough if you'll flash this SBF over ver 4 froyo (not Chinese or Korean) but i recommended CG35 and CG61 to make such sbf enough to flash over system downgraded with fixed sbf + nandroid.
 

ephumuris

Senior Member
Dec 7, 2008
3,706
637
36
Hull
Xiaomi Mi Pad 5
Google Pixel 7 Pro
Well i made an sbf version of miui and it works :D

Wonder if it works on other peoples Defy? :)

Tested by formatting system and then applying sbf. Booted back into MIUI like a dream :D

EDIT:

Shame the SBF comes out at 300+mb :( May take a while to upload these things lol.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 20
    With Epsylon3 brilliant work, a new idea of flashing custom firmwares came to surface, allowing custom /system partition to be flashed directly from RSD Lite! This way you don't need to flash fixed SBFs and waste time with rooting and recovery install in case of system screw-up.

    What you need:
    1) MotoAndroidDepacker. With it, unpack sbf of the firmware you use as base.
    2) Leave CG35(boot) and CG61(devtree) partition files, delete other smgs. Other files are not that important. You can delete all partition files if you're making backup for yourself...
    3) Replace CG39(system) with your system dump:
    adb shell:
    su
    dd if=/dev/block/system of=/sdcard/CG39.smg
    copy CG39.smg from sd card to your firmware folder.
    4) Compile sbf with MotoAndroidDepacker.
    5) Flash your sbf in case of failure.

    MAJOR CAVEAT: This sbf will work ONLY on devices with have same full SBF version applied last as your device. I.e. if you have flashed 3.4.2-107 and then upgraded it with nandroid to 3.4.2-177, the sbf you created from your system dump will work only for devices which flashed still 3.4.2-107 sbf last. To install such (custom) sbf, one would need to flash full 3.4.2-107 sbf first.

    Technical: this is possible because of bug/feature in flashing process: system signature partiton is not checked if phone signature is already present. Phone signature is generated when flashing full genuine sbf and is verified aganist copy in sp partition and obviously differs for each firmware. It is stored at the end of the system partition.
    1
    i think you can create a Full SBF with all original partitions and your "signed" CG39

    I think it is not a bug... the thing is : i'm not sure sbf can work on other devices ... but anyway... it can be really usefull to recover device or to create a full backup with the good kernel made for the /system and /devtree

    mbr and ebr are needed too, if the partition table has changes, you will have problems..
    1
    Where i can finde the MotoAndroidDepacker?;)
    1
    I'll read this thread more carefully ASAP, but can this trick help flashing a manually rooted /system partition for those that are stuck at official 2.3.4 with no root and no downgrade?