[HOWTO] Creating custom SBF firmware - Defy Android Development

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.

Great news.
Some question:
If I install a full sbf. IE: 3.4.2-117 and then apply a custom ROM over it (CM).
So can I make a backup of my system and flash it again in case of any brick?

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!

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....

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

So would it be possible creating custom bootmenus as these are updated by sbf's too?

If your current system contain boot menu. The custom sbf also, it is identical with the current system.

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..

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 .

Does this means that someone could create a sbf wich flashs dierctly CM7 or MiUi?

IE-coRe said:
Does this means that someone could create a sbf wich flashs dierctly CM7 or MiUi?
Click to expand...
Click to collapse
It's possible too.

Where i can finde the MotoAndroidDepacker?

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

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 ?

So if i wanted to do this i split my sbf, delete everything only leaving,
CG35.SMG
CG61.SMG
firmware.hmg
Then system dump and add that CG39.smg in and build and flash?
Have i missed anything?

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.

Is it possible to keep all files and just replace CG39? Or are files removed for a reason? Thanks for replying.

You can keep all files, theoretically.

Well i made an sbf version of miui and it works
Wonder if it works on other peoples Defy?
Tested by formatting system and then applying sbf. Booted back into MIUI like a dream
EDIT:
Shame the SBF comes out at 300+mb May take a while to upload these things lol.

If I mount the CG39 as a loopback device in a linux box,
Can I just replace the contents and it will retain the signature?
Or the signature is based in a checksum?

Related

Request for radio.img of MZ601

I am trying to convert a MZ600 to MZ601.
I assume there are no actual hardware differences, but only software.. and I have not found any sources/info proving otherwise...
I have allready fastboot-flashed system/user/boot/recovery of MZ601 Europe stock images, to my VZN MZ600 Xoom and everything works fine except the mobile-network ofcourse...
(btw SIM is working!)
So how can I flash the baseband to the European one ?
Is the radio.img all I need ?
In that case, can somebody send me one?
I have tryied a full EU firmware flash with RSDlite, but I get an error "Unable to retrieve initialization values from INI file." so I cant start flashing...
Any ideas?
Thanks
I saw in other thread you have gsm sbf, perhaps using sbf recalc or sbf depacker you can extract its radio image..
please check this link
http://modmymobile.com/forums/402-general-motorola-android/530781-sbf-depacker-1-3-03-22-2011-a.html
http://and-developers.com/sbf
I thought the recovery / img files were on motorola's website now?
Thanks lesjaw , I will try..
(I did a search for sbf extractors but did not find those ones! )
Lothaen , motorola gives away the common partitions, (userdata/system/boot/recovery) and not the hardcore ones such as the radio one!
lesjaw, I tried both software. They both allow me to split files, from the SBF.
That results into 13 SMG files, which I assume are partitions (and something else?)
What format are these ? can I open them ? How do I identify the radio.img
is the IMG format same as SMG ?
MotoAndroidDepackerMono, has an option to extra radio.img, but thats from an update.zip, which I what I am trying to create
i see, honestly I never use those app, in sunday i'll give a shot..
btw, you can join #milestone-modding in freenode (irc), many of those members channel have good experience regarding sbf file..
good luck brother..
Any idea anyone, how to identify the radio image, from a SBF extract to SMG files ?
Once identified, can I use an SMG file as a "radio.img" ?
HMJ37 sbf
Motorola did just release a few days ago a new sbf for the MZ600 that is the full HMJ37 version. Here is the full file name out of the latest spreadsheet for anyone with RSD access:
VZW_MZ600_Signed_HMJ37_Signed_MDM6600BP_C_02.0F.00R_SW.combo.sbf
I think he needs an image from MZ601, not MZ600!
its been quite some time, and have not yet found an answer to this problem!!..
attached is the export from the SBF file of MZ601
I asume one of these files, is the radio.img , correct ? which one is it?
Can I do a fastboot flash radio radio.img ,using one of these files!?
Is it safe to try with the user partition to confirm my theory ? (I can identify it, from the byte size)
I tried to open the images with unyaffs-x86-win and cygwin but I always get an error message "broken image file" even on motorola's official images, hence I've got something else wrong (?)
So many questions left unanswered for so long! and I though XOOM was for hardcore android users!
nikil511 said:
its been quite some time, and have not yet found an answer to this problem!!..
attached is the export from the SBF file of MZ601
I asume one of these files, is the radio.img , correct ? which one is it?
Can I do a fastboot flash radio radio.img ,using one of these files!?
Is it safe to try with the user partition to confirm my theory ? (I can identify it, from the byte size)
I tried to open the images with unyaffs-x86-win and cygwin but I always get an error message "broken image file" even on motorola's official images, hence I've got something else wrong (?)
So many questions left unanswered for so long! and I though XOOM was for hardcore android users!
Click to expand...
Click to collapse
Are you sure that's from a MZ601 and not a Wi-Fi only MZ604 (see the "HUBBLE" and "WIFI" strings)?
You cannot fastboot flash the radio partition (which probably is called something like bpsw given this is a Motorola device). Given that these are proprietary firmware blobs, do not expect to get far assuming that these are yaffs/ext/whatever filesystem images.
thisi is where i found the SBF
http://www.mod2xtreme.com/showthread.php?t=10571
so I assume it has the radio partition.
So if I can not extract it from the SBF, how are all these baseband update zip been constructed on all other tablets/phones ? why are there none for XOOM eventhout various baseband versions exist ?
or this h.6.2 means that should be for mz604(wifi only) so it should contain no baseband image. ?
convert mz600 to mz601
hello all,
nikil511 , did you found any solution? i'd really like to convert my mz600 to mz601 !
concerning the sbf, because of the name we know it's from the wifi xoom.
but as info, the radio is cg5
regards
http://sbf.droid-developers.org/everest/list.php here new full image
in amms_sec.mbn
we can find string for new firmware VTHUBBLE_N_01.100.07P
or in rdl1.smg ..
how to use it? or convert to .img in .zip file ?
i do it
http://forum.xda-developers.com/showthread.php?t=1845212

[Q] Android: Recovery backup without recovery.

So, is there's a software which could do a recovery backup without booting into recovery?
(This is technically possible and YaffsExpert can already backup the images separately, am just wondering if there's an app to make a CWM compatible backup.)
I'm sure it is technically possible, as we don't have such a tool. Manipulating .img files is not the same thing than creating them. Probably unmounting some part of the file system is a part of the explanation...
YaffsExpert already does the .img part.
so far, no tools for that..

[Q] The more I read, the more confused I get

New to Android, about 3 weeks now with my Rogers 1727R. I've been trying to grab all the good files and build my understanding of returning my phone to it's stock ROM if I have to return it or if I brick it etc. But I seem to have downloaded, from this forum, so many files, with different names and files sizes, I'm confused about what does what. So I'm asking any senior people here if they can tell me what I have, what it does, and whether I need it. Here goes:
Stock_ROM_SGH-I727R-UCKJ2-k0nane.7z - Think this is a stock ROM but un-bloated. It's 257 MB.
i727_stock_kernel_odin.tar - It's 10 MB, appears to be a stock AT&T ROM, but perhaps just the kernel, not the whole ROM?
Stock Recovery.tar - It's 6.08 MB. Downloaded it today.
Nandroid backup - 841 Megs with data.ext4.tar, system.ext4.tar, boot.img and recovery.img which I thought was a complete image of my ROM.
Look at the size differences. From 6 MB up to 841 MB. What the heck are all these files?
harry_fine said:
New to Android, about 3 weeks now with my Rogers 1727R. I've been trying to grab all the good files and build my understanding of returning my phone to it's stock ROM if I have to return it or if I brick it etc. But I seem to have downloaded, from this forum, so many files, with different names and files sizes, I'm confused about what does what. So I'm asking any senior people here if they can tell me what I have, what it does, and whether I need it. Here goes:
Stock_ROM_SGH-I727R-UCKJ2-k0nane.7z - Think this is a stock ROM but un-bloated. It's 257 MB.
i727_stock_kernel_odin.tar - It's 10 MB, appears to be a stock AT&T ROM, but perhaps just the kernel, not the whole ROM?
Stock Recovery.tar - It's 6.08 MB. Downloaded it today.
Nandroid backup - 841 Megs with data.ext4.tar, system.ext4.tar, boot.img and recovery.img which I thought was a complete image of my ROM.
Look at the size differences. From 6 MB up to 841 MB. What the heck are all these files?
Click to expand...
Click to collapse
the .7z file is a 7zip archive of the stock UCKJ2 rom...you would need to use 7zip to extract the contents before flashing with ODIN
the .tar file you listed is indeed just the kernel, not the entire rom, and it is from the AT&T version
stock recovery.tar is exactly that. its the stock recovery to replace clockwork mod should you need to return to that.
your nandroid backup is the entire system, a direct image of everything you had on your phone when you created it. this includes all settings, installed apps, etc
the .7z file is a 7zip archive of the stock UCKJ2 rom...you would need to use 7zip to extract the contents before flashing with ODIN
your nandroid backup is the entire system, a direct image of everything you had on your phone when you created it. this includes all settings, installed apps, etc
Click to expand...
Click to collapse
So let's say I wanted to get back to my ROM the way it was the day I bought it. The Nandroid backup was done after rooting the day I bought it. So if I uncompressed the .7z file, is that what I would flash to get me back to square one, or the Nandroid backup?
harry_fine said:
So let's say I wanted to get back to my ROM the way it was the day I bought it. The Nandroid backup was done after rooting the day I bought it. So if I uncompressed the .7z file, is that what I would flash to get me back to square one, or the Nandroid backup?
Click to expand...
Click to collapse
the nandroid will get you back to the way YOU set it up. it wouldnt do squat for getting it back to stock.
the 7z file should take you back to stock.
its not complicated, you are just overthinking it.
a nandroid backup is YOUR backup, nobody elses. its an image of YOUR phone as YOU set it up. if you made the nandroid after rooting, and you restore from the nandroid, you will still have root, because its a direct image of your rooted phone. it will include all your settings, installed apps, and configurations.
That is very helpful. Last question.
What is a Stock Recovery file? You referred to it, and I see it's a rather small file, so it's not a ROM or Kernel. The name makes it sound like it's my stock ROM.
I know it has to do with CWM.
Any edification would be helpful.
Please keep questions in the Q&A section.....Thank you.
No recovery is not the rom. Recovery is like if u owned a computer around 1995 you had ms dos and windows well dos would allow you to make changes to windows that would not affect dos. Pretty much same thing. Recovery is where you flash the roms from but the roms do not change recovery. Cwm is clock work mod recovery . If you used odin to flash stock firmware tar tht woukd change your recovery from cwm to the stock recovery but i do now see we have a recovery tar where u can just flash the recovery tar but not the entire stock firmware tar.... to be honest id suggest doing alot of reading before you start messing with these things
---------- Post added at 07:32 PM ---------- Previous post was at 07:27 PM ----------
Get on youtube and look up videos by qbking you can learn alot from them there for the epic not our device but u can more understand the basics if u watch them

Allwinner A10/A13 device firmware backup script/tool

Hello All, this is my first post in Xda-forum, I love they way u all interact and help each other out here...well u see I hav a Allwinner A10 based tablet called Ice Xtreme which is very cheap in India do a google search on this tablet. well the company did not provide any software and I had corrupted mine while trying to use a custom recovery which was not from a allwinner a10 based tab. Anyways after alot of fuss I got it fixed but still they did not provide me with the livesuit image. I looked for ways to backing up my current working firmware from my tablet but found none. So after alot of searching I found this Script at a forum which can dump the recovery, the bootloader, boot partitions and system and data folder. But throughout my experience with this Livesuit firmware things I see that the drivers inside the vendor folder are also important as no two tablets have same chips (some thing will be different) so I modified the script and build it into a script that takes most of the directories (excluding mount,as it has only ur SD n extSD data) The dump thus created may help in modifying another image to suit ur needs.
I have only been able to backup directories and boot,recovery,bootloader partition thanks to the original script. I have no Idea how to send/restore these files to the device after flashing another rom to restore most of the things. Any help would be a boon. Thank u all for ur indirect help in bringing out the geek in me.
Try it!! & post feedbacks and suggestions...
This helps to backup the rom files with only adb. Just start the batch file & relax while ur ROM is being dumped.n it will also keep a copy on ur SDcard too.
Just use
#adb backup
for back up and
#adb restore
for restoring
# command...
But will it be possible to extract different files???!!
Hey, suppose I wanna flash a custom ROM which doesnt hav all of my boards drivers in it. So if I backup using adb can I thn restore driver files from the stock ROM backup to the new Custom ROM...
how to write backup ???
extension *.tgz??/
need expalain for restore backup..
thx..

Which is the 5.0.1 img file?

Note: OTA updates don't work on my Nexus 5 due to TWRP blocking them. Now my phone doesn't recognize the OTA update anymore (When my phone went to install the OTA updated and rebooted, it rebooted into TWRP instead and completely ignores the updates existence since then). To fix this I plan to simply push the factory img of 5.0.1 to my device directly. I downloaded the factory .img from Google's website .
However instead of a .img file i'm used to, I got a .tgz. I extracted that and got a .tar and then extracted that to finally get my folder with the .img files. However now I'm not sure which one to push to my device. There is a img file called "radio-hammerhead-m8974a-2.0.50.2.22.img" but judging by the file size, I don't think that's the correct one (only 45MB). There is a .zip file called "image-hammerhead-lrx22c.zip" but this contains multiple .img files, the largest one called "system.img". I'm guessing this is the correct one to push to my device via adb since it's about 1GB in size?
I suspect pushing the entire .zip file to my phone and flashing that would be bad as it looks like it'll overwrite TWRP?
Any help would be greatly appreciated.
Here's a lot of useful information about OTA's Check it out: http://forum.xda-developers.com/google-nexus-5/general/info-nexus-5-ota-help-desk-t2523217
You'll need boot and system at least,
If you plan on keeping twrp and root, you may as well just flash one of the flashable zips already available in the development forum
Actually you should have a radio and bootloader img file. First one is - as the name says - the latest radio software (which is needed for GPS, WiFi, cellular network and so on). Second one is the latest bootloader. I'd update them both.
From the zip archive you should only flash certain imgs - if you flash all your data will be wiped (factory reset). What img files does the zip contain?
Why are you pushing them to your phone? You need to flash with fastboot from your computer. There is not just one img file for the update, there are several for different partitions on the phone. Have a look through some of the guides in the general section. Also, flashing one of the stock flashable zips would be much faster, but why not learn a little as you update.
Vomer has a thread of flashable 5.0 and 5.0.1 stock Google ROMs. Don't worry about factory images because you will lose everything once you flash these and it's a much bigger pain imo to back everything including internal on your phone up.
snappycg1996 said:
Don't worry about factory images because you will lose everything once you flash these
Click to expand...
Click to collapse
Not necessarily true.
You can flash bootloader, radio, and system without losing anything. You'll just have to reroot afterward.

Categories

Resources