[KERNEL] Any Kernel Updater (Moded for eMMC) - G2 and Desire Z Android Development

I have just edited the AnyKernel updater script by koush to work with eMMC devices :-D
hope ppl can make use of this
its very simple
1) grab the .tar.gz file
2) extract
3) add the zImage to the /kernel/ directory
4) add .ko modules to /system/lib/modules/ directory
5) **optional** change the boot partition location in the updater-script (not normaly needed)
6) zip up the file
7) its ready to flash in CWM
Credits
Koush for the original boot unpack / repack bin's and scripts
IEF for the stand alone dd binary

what does it do?? sorry
does it make so you can update thru your network?

Thank you! This will be useful to me.

Nice, this is exactly what we needed.
Sent from my HTC Vision

Thanks!! I can finally make an Update.zip for my kernel!

nice work.
Now any kernel devs. can easy make a update.zip

G1_enthusiast said:
what does it do?? sorry
does it make so you can update thru your network?
Click to expand...
Click to collapse
Classic...lol
Why do ppl who have no clue even post stuff like that?
Thanks Apache this will come in handy.
Sent from my HTC Vision using XDA App

any chance to rip bootimg.cfg through the zip file?
since somehow I tried to get the cfg file from the boot.img but seems the boot.img and zImage in some kernel are the same.

Related

[How to] Rom cooking

Original post:
Hello,
I am new to android but not to linux. I used to tweak my winmo phone rom.
I have backed up my device with nandroid. I just need some explanations:
- why isn't the radio extracted?
- how can I "extract" does .img files to modify and then rebuild them?
I found some informations of what the .img files contain here: ROM Partitions it should be the same for Hero
I have found some informations on how to push updates to the rom by looking at modaco updates. It seems quite simple to delete/copy files on the hero rom using an update-sript file. I am however curious about the RSA cert and if some files need to be signed.
Any information welcomed.
Regards
Click to expand...
Click to collapse
How to
Extract NAND image files
To extract .img files, I have found unyaffs from http://code.google.com/p/unyaffs/ I have compiled it under ubuntu 64 (attached). Unyaffs works on system.img but on no other .img file
To extract boot.img use attached extract-kernel.pl and extract-ramdisk.pl
# extract-kernel.pl boot.img
# extract-ramdisk.pl boot.img
Should work for recovery.img but haven't tried as custom recovery images on the forum are great.
Rebuild system.img
Seems you just need "to loopback mount an image on your linux box and format it with YAFFS".
But it is useless as because Hero's SPL does not allow flashing system.img directly. You should use an update.zip package for that. (read below)
Rebuild boot.img
After extracting your boot.img using attached extract-*.pl and tweaking it, in same folder run:
# mkbootfs boot.img-ramdisk | gzip > ramdisk-boot
# mkbootimg --kernel boot.img-kernel --ramdisk ramdisk-boot --cmdline "no_console_suspend=1 console=null" -o newBoot.img --base 0x19200000
Creating an update.zip package
Creating an update.zip package is quite easy in fact. For example, to add a (valid) test.apk package to your rom:
- create an empty folder <workdir>
- create folder structure for test.apk (<workdir>/system/app) and copy the test.apk
- create folder structure for update-script (<workdir>/META-INF/com/google/android)
- edit <workdir>/META-INF/com/google/android/update-script
- put in it:
Code:
show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM:
set_perm_recursive 0 0 0755 0644 SYSTEM:app
show_progress 0.1 10
- compress the <workdir> content to zip (not the <workdir> folder itself)
Now you are going to sign the zip file. Download attached testsign.zip and copy it in your <SDK>/tools folder. Extract it here. It should create a sign subfolder with a testsign.jar file in it.
Then, from <workdir> folder, do:
java -classpath <SDK>/tools/sign/testsign.jar" testsign file.zip file-signed.zip
Ok, now your zip file is ready to be deployed using cyanogen recovery image.
To find more command to use in update-script, look at other's.
Modify .apk package
Seems it is easy to uncompress an .apk package (zip) an to modify files in it and then compress it. But after all: you must sign it like update.zip packages.
ODEX files
- What are those Odex files? Answer.
- How to get rid of them?
Odex files depend on framework they are made for. To deodex an odex file use that how to
Then you may create a classes.dex file by executing the smali program on the "out" folder. You then rename it to classes.dex and add it to the .apk.
- How to create them?
Use dexopt-wrapper on device.
Porting an other device's rom
Well, that part is easy
- extract the system.img
- extract boot.img
- replace boot.img-kernel with the one from your stock Hero rom one.
- rebuild boot.img
- build update.zip package (look someone's hero custom rom to see how to do it)
- sign and flash
It should run place and make calls but probably won't have Wifi, BT, trackball support. If you make those work: tell me, but I think we should wait to be able to compile a 2.6.29 kernel to have those.
Tools
Androsign script (linux)
I wrote that androsign script to quick sign zip files. Just put it in your <SDK>/tools folder, then chmod +x. If you have put the tools folder in your PATH, you can call it directly like this:
androsign /dev/folder1/folder2/update.zip (or any zip/apk file)
It will output an update-signed.zip (or app-signed.apk etc) in the same folder than original file was in.
Notes
Note1: thanks
Thanks to every guy that helped me found all that.
Note1: sharing
I searched for hours, so I am more than happy to share it to save someone's time. I am just disappointed than some people here do not have that spirit: I could have use those hours for development instead of research...
Note3: corrections
So, if you found anything incorrect, would like to supply more informations or want to correct my bad english: just PM me.
To find
- how to dump radio from device
- how to build a custom hero kernel (waiting for HTC sources)
To come
How to prepare your own kitchen and useful scripts (linux)
gecka said:
I am new to android but not to linux.
Click to expand...
Click to collapse
Same here. I do lots of tweeking on my linux machine, so i know quite a lot of linux. If there would be anyone to answer those questions by gecka, I might start tweeking the rom (maybe someday cook one up)
Best regards
Hello,
First post edited, but still some ignorances... Please share if you know anything.
Best regards
unpack and pack boot.img and recovery.img
First you need utilities such as mkbootfs and mkbootimg. maybe you can find them online (i can upload them later compiled for linux x86-64) but i suggest you download android source (http://source.android.com) and do a generic make. In this way you have these and other utilities(tools to pack system.img too, but if you haven't an engineering bootloader you can't flash it directly) in /out/host/... (it's better if you add this in your PATH)
To unpack and pack boot and recovery, read here:
http://forum.xda-developers.com/showthread.php?t=443994
or here:
http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
...or...
(I have attached extract-kernel and extract-ramdisk scripts from JF build environment) :
to unpack (boot.img or recovery.img, i'm writing the commands with boot.img):
Code:
extract-kernel boot.img
extract-ramdisk boot.img
at this point you have
boot.img-kernel
boot.img-ramdisk
to repack (boot.img or recovery.img):
For hero you need to specify the base address because it's different (0x19200000). For more information: http://forum.xda-developers.com/showthread.php?t=541522.
Code:
mkbootfs boot.img-ramdisk | gzip > ramdisk-boot
mkbootimg --kernel boot.img-kernel --ramdisk ramdisk-boot --cmdline "no_console_suspend=1 console=null" -o newBoot.img --base 0x19200000
Useful resources for android modding are the dream forums (most of the concepts/hacks works for hero too):
http://forum.xda-developers.com/forumdisplay.php?f=448
(informative thread here: http://forum.xda-developers.com/showthread.php?t=519523)
note: mkbootimg with --base support is in donut and master (or find the patch on gerrit and apply it to cupcake)
First of all, the reason you cant unyaffs anything other than system.img is because they aren't YAFFS images. boot/recovery is kernel+initrd like in any normal linux bootimage scenario (see more below).
Tofind
- how to dump radio from device
Click to expand...
Click to collapse
Haven't gotten into that myself yet, but I know modaco posted an update.zip with radio image included on this very forum. Look for it.
- how to extract NAND images other than system.img
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?t=443994
- rebuild NAND images such as system.img
Click to expand...
Click to collapse
This isn't hard, just loopback mount an image on your linux box and format it with YAFFS.
Building a custom kernel and recovery binary
HTC hasn't yet released the changes they have made to the hero/dream/magic kernels, 32A board, so you can't just compile a kernel from the AOSP. I haven't tried it yet but this patch might work on hero too:
http://forum.xda-developers.com/showthread.php?t=548061
EDIT: HTC Sources for dream and magic at http://developer.htc.com
For building a custom recovery, it's better if you use cyanogen's recovery code, found in his git : github.com/cyanogen, because it already has menus for nandroid and other tools, but you can use the recovery code from AOSP too (cyanogen's one is a patched version with a lot more features, http://forum.xda-developers.com/showthread.php?t=523558). To make a custom recovery you need to change the recovery binary (because the press event of the hero trackball has a different keycode, 191), the kernel and the init scripts. Actually i don't remember what else I've changed to make cm's recovery working with hero (the recovery that we are actually using here), I'm at work now, but i'll check later and post more details, or you can just unpack the recovery and see the changes .
First post updated.
Nandroid only backs up the partitions in the main storage nand, but radio and spl are flashed to the radio's own nand flash. Whether it's possible to dump it or not I don't know, but honestly, I don't see why you'd want to. Radio images are available through RUU's and I don't think editing would be an easy task
jubeh said:
Nandroid only backs up the partitions in the main storage nand, but radio and spl are flashed to the radio's own nand flash. Whether it's possible to dump it or not I don't know, but honestly, I don't see why you'd want to. Radio images are available through RUU's and I don't think editing would be an easy task
Click to expand...
Click to collapse
Sometimes, new radio images appear on new phones. That is why I am looking on a way to extract it.
very useful thread.
Very nice tutorial, thank you!
could you please specify a bit more on how to clone from android's git and then build the mkbootimg and mkbootfs (just make, right)? I tried and I keep getting a "fatal:server dumped connection" error
Are we able to modify an official ROM (also for hero). Which shows up in RUU as INFOsignature checking... failed. Am I able to change the kernel and make it work?
jubeh said:
could you please specify a bit more on how to clone from android's git and then build the mkbootimg and mkbootfs (just make, right)? I tried and I keep getting a "fatal:server dumped connection" error
Click to expand...
Click to collapse
What command do you use?
In fact i won't be able to explain you better than that page: http://source.android.com/download
Following that how to, you'll be able to sync an android branch You can learn more about git, branches and more here (Repo and Git resources)
The sync is long (2.9Go). Then, to build mkbootimg and mkbootfs, you should do a generic build of android going to source folder and issuing the 'make' command.
All that will be part of my upcoming "How to prepare your own kitchen and useful scripts".
awsy44 said:
Are we able to modify an official ROM (also for hero). Which shows up in RUU as INFOsignature checking... failed. Am I able to change the kernel and make it work?
Click to expand...
Click to collapse
Well, to grep the system from a windows RUU exe file you should launch it and then look in your user temporary folder for a rom.zip file in a {uid} subfolder. It contains the system and boot img files.
You then need to make an update.zip package from them. Have a look to someone's hero custom rom and to it's update-script to see how it is achieved. My 'How to' gives you all you need to understand update.zip packages and to extract system.img.
If you are porting a Hero rom, no need to change the kernel.
Regards
Well, to grep the system from a windows RUU exe file you should launch it and then look in your user temporary folder for a rom.zip file in a {uid} subfolder. It contains the system and boot img files.
You then need to make an update.zip package from them. Have a look to someone's hero custom rom and to it's update-script to see how it is achieved. My 'How to' gives you all you need to understand update.zip packages and to extract system.img.
If you are porting a Hero rom, no need to change the kernel.
Regards
Click to expand...
Click to collapse
Thanks so much for this amazing information, however how do i stop getting hit with the infosignature failed error? is that the kernel or the hboot? it says 12 signature verify error.
Oh, I do have the source and I am running my own donut build on my dream with some of my spice, but the problem I was having was cloning that exact project (mkbootimg) from android.git.kernel.org using git, but when I read what you said, I remembered that when you make the build, it also compiles several tools and i overlooked checking the out folder for it, kind of dumb on my part since I had already pulled the fastboot tool from that build and added it to my own bin, i guess mkbootimg and mkbootfs should be there too, right?
i tried running androsign and got this error
Code:
[email protected]:~/android/dev/sdk/tools$ ./androsign META-INF.zip
Exception in thread "main" java.lang.NoClassDefFoundError: testsign
Failed!
[email protected]:~/android/dev/sdk/tools$
if i use a ROM of one device on an other different device, I think I must build a kernel on my own, is that correct?
but what config should I use? a config from my current running ROM? then I think I must make it suitable for new ROM, what options should I care about?
for example, if I want to run a AOSP 2.01 ROM ( system.img) on a Magic 32A device with SPL 1.76, and now I am running a SenseUI ROM which kernel is 2.6.27, I think I should build a 2.6.29 kernel from the git tree, and ensure it will work with camera/bt/wifi/trackball of my device properly first .
how can I make this step successful?
other hand, the dynamic lib files(.so) with the system.img can be incorrect. so, I may need to build them too for pairing with the kernel I built in previous step. I think applications will work properly because they only care about if the interfaces of kernel and lib is correct. for that, also there some config job (like build.prop, etc) to do, is there a list of all of these jobs? and what values can I refer to? the original ROM (Magic 32A SPL 1.76 working ROM here) ?
am I right? what should i do and what are in those steps? are there some doucments I can read from?
Thanks for the good summary. Just one question, where did testsign.jar come from? I'd like to get the source. Thanks!
JackZero said:
Thanks for the good summary. Just one question, where did testsign.jar come from? I'd like to get the source. Thanks!
Click to expand...
Click to collapse
Read this !
http://www.androiddevelopment.org/tag/apk/
;-)

Problem flashing custom kernel

We have the Ava-Froyo 2.2 ROM with stock kernel (I think).
We got the source for the new kernel and re-compiled it with a flag we need.
We are trying to flash the kernel using "fastboot zimage c:\zImage" and "fastboot kernel c:\zImage" but neither work. We keep getting sending 'zimage'... OKAY then writing 'zimage'... FAILED (remote: not allowed)
We can't figure it out.
I ran unrevoked3 latest and set S-OFF and bootloader confirms it is S-OFF.
Why can't I write to flash/kernel??
How else can I flash a custom kernel?
I have ClockWork Mod 2.5.0.1 installed.
I only found one thing which said something about unrevoked's method makes you lose some of the advanced fastboot functions????
You can flash kernels from the clockwork recovery just like you would flash a rom. Just do it after you flash the rom of choice.
Sent from my PC36100 using XDA App
OK, but it looks like I can't just drop zImage on the SD and get CWM to flash it. It looks like I have to put it in an update.zip or something. Any ideas how to make one for my new zImage file?
Any other thoughts on how I could fastboot flash zimage w/out it complaining of out of memory or whatever?
Thanks in advance!!
why in the world are you doing it this way? simply create a flashable zip and flash it like you would a ROM
t3project said:
why in the world are you doing it this way? simply create a flashable zip and flash it like you would a ROM
Click to expand...
Click to collapse
+1 I agree with this guy. just create a flashable zip and voila.
Is this how you guys do that?
Step 7 - http://forum.androidcentral.com/htc...how-build-your-own-kernel-package-source.html
1. You probably don't have the eng bootloader that allows you to use fastboot.
2. Get any custom kernel in zip package, open it, delete everything you don't need and insert your zimage where the custom kernels zimage is. Keep the "kernel" and "META" directory and just replace your zimage in the kernel directory in the zip.
At the risk of sounding like an I ass I have to ask, how do you not know how to use fastboot or make an update.zip yet you managed to recompile the kernel? That one just goes over my head.
Well I didn't recompile the kernel, BUT I have re/compiled kernels for ~16 years so I know that part pretty well.
I just expected fastboot to work. I think my comment about unrEVOked borking fastboot is accurate then if you agree about the Eng loader.
I will grab a kernel zip and put that in. I saw these kernel scripts in one of them so I was thinking it is a lot of work to make that put, but what should my kernel script look like or do I really need one (this is in the .zip I update)..
IPvFletch said:
Well I didn't recompile the kernel, BUT I have re/compiled kernels for ~16 years so I know that part pretty well.
I just expected fastboot to work. I think my comment about about unrEVOked borking fastboot is accurate then if you agree and the eng loader.
I will grab a kernel zip and put that in. I saw these kernel scripts in one of them so I was thinking it is a lot of work to make that put, but what should my kernel script look like or do I really need one (this is in the .zip I update)..
Click to expand...
Click to collapse
I said it was at the risk of sounding like an ass and at least you came through and said you have re/compiled kernels before.
ENG bootloader would be my best guess as to why your fastboot is not working. I rooted with unrevo.forever and my fastboot works AFTER I replaced the bootloader.
If you use a zip package from a custom kernel like netarchy or kingklick the script is already there along with the scripts needed to install the kernel. You just have to place your zimage where that kernels zimage is and the scripts handle everything.
EDIT: I didn't make the zip but it should help you in the "write" direction (pun intended).
Examine the contents and the updater-script file.
How did you replace the bootloader after?
Ok so I got the HTC stock kernel 3.26 zip and I pulled out boot.img and replaced it with my zImage file renamed to boot.img. The update-script looks like it has no other major dependencies, the module is in the zip still, that stock one is Ok for me.
Code:
assert compatible_with("0.2") == "true"
show_progress 0.1 0
format BOOT:
copy_dir PACKAGE:system SYSTEM:
set_perm_recursive 0 0 0755 0755 SYSTEM:lib/modules
write_raw_image PACKAGE:boot.img BOOT:
show_progress 0.1 0
So.... here goes (via CWM Recovery)...
Crap what did I do wrong. It won't boot now, it goes into bootloader all the time.
Here's the zip I just tried...
IPvFletch said:
Crap what did I do wrong. It won't boot now, it goes into bootloader all the time.
Here's the zip I just tried...
Click to expand...
Click to collapse
Check my last post before this. You're problem is you tried to install it as a boot.img file and the boot.img file holds the system image as well as the kernel.
To install a kernel alone it has to be a zimage file and installed differently.
I pushed the original htc-froyo-stock-kernel-signed.zip kernel update just now and it is booting again.
Gonna guess something to do with the signed zip yet unsigned kernel boot.img?
How can I fix my zip with my new zImage?
lovethyEVO said:
Check my last post before this. You're problem is you tried to install it as a boot.img file and the boot.img file holds the system image as well as the kernel.
To install a kernel alone it has to be a zimage file and installed differently.
Click to expand...
Click to collapse
OK I kind of thought that but didn't know. I know boot.img is the whole boot partition not just the kernel image. doh. :]
Ok back to YOUR/koush kernel installer .zip...
The update-script has no mention of zImage though, so do I need to do more than just dump my zImage into this zip? EDIT: Guess so got error 6 it aborted.
IPvFletch said:
OK I kind of thought that but didn't know. I know boot.img is the whole boot partition not just the kernel image. doh. :]
Ok back to YOUR/koush kernel installer .zip...
The update-script has no mention of zImage though, so do I need to do more than just dump my zImage into this zip? EDIT: Guess so got error 6 it aborted.
Click to expand...
Click to collapse
Check the updater-script. You will see what happens in the process.
If anything, send me your files and I can test install them onto my system.
OK so it dumps system and kernel into temp folders. For kernel it goes through the entire folder and sets perms 4 of the 5 files (excluding zImage) and then runs dump_image. This I guess is smart enough to pick up zImage and dumps it all into a new boot.img. Then eventually it runs mkbootimg which takes zImage and the new boot image ramdisk and creates a new shell. Then it runs that shell.
I don't see why it fails though. I didn't put any modules in there but it looks like it doesn't need me to. I already have the latest versions of those kernel module files anyways.
lovethyEVO: Post 11, thanks!
So if I understand correctly, in post 11 you renamed the zimage to boot.img?
Just making sure so I know how to test it.
LOL oh yes that is that zip HAHA sorry.
No go through zip. Gave me status error 6 and because I use fastboot mostly I'm not sure how to correct it.
Flashed it through fastboot:
fastboot flash boot zImage.img = FAILED <remote: image error! <BootMagic check fail>
fastboot flash system zImage.img = OK but stuck at splash screen which I expected.
But now you have a general idea of what's going. It's possibly your kernel and maybe not just the zip file.
Can someone just put this zImage in a kernel flash zip for me? I will try later as well but clearly I'm not good at this.. :]
The zImage is in a .zip file attached. Thanks!

[10 JAN][SCRIPT]IMG2CWM Converter 1.2.2

birkoffsjunk's HD2 IMG2CWM Converter​
A simple windows batch script to convert DAF builds to Clockwork Recovery ZIPs.
Originally designed for MDJ's Gingerbread NAND and posted here. Results may vary!
Instructions​
Download DAF based NAND ROM
Download & Extract this script
Place Boot.img & System.img into the 'in' folder
Double click 'RunMe.cmd' (not as admin)
Manually make any changes you wish (when prompted)
Once done, update.zip will be in the same location as 'RunMe.cmd'
META-INF Info​How to: Create Clockwork Recovery flash files
How to Create Android Update Zip Package
An updated updater-script (META-INF\com\google\android\updater-script) is required for various other Builds.
Downloads​v1 >>> here <<<
v1.1 attached (7z changed to 9.20 (ghostkid2010) & renamed out folder to temp)
v1.2 attached (Added error checking & support for system.img only)
v1.2.1 attached (Specified xcopy path & removed old 7z.exe)
v1.2.2 >>> here <<< (arif-ali's linux bash script)
Addons​arif-ali's NexusHD2-Gingerbread_V2.0 updater-script
TODO​
Add error checking
Add support for system.img only
META-INF Information
Most importantly keep it simple
License​BSD License for the script not the tools
7zip is GNU LGPL
unyaffs is GNU GPL v2
same post from MDJ
Your script works great extracting the .img file. But it's not able to create zip file. Let me edit your script with the missing file/info.
Download this file and put in folder tools;
http://downloads.sourceforge.net/sevenzip/7za920.zip
change this line;
"%LOC%\tools\7z.exe" a "%LOC%\update.zip" "%LOC%\out\*"
to;
"%LOC%\tools\7za.exe" a "%LOC%\update.zip" "%LOC%\out\*"
and it should work. it will create a zip file.
Enjoy
how it works?
How does it use? What things do I have to put in the folder "IN"?
sathara said:
how it works?
Click to expand...
Click to collapse
let you extract system.img and boot.img from android build, once you extracted all the fill, it will put all the file into a zip file so you can load via CWM
VuNhatVan said:
How does it use? What things do I have to put in the folder "IN"?
Click to expand...
Click to collapse
boot.img & system.img
It has a function to edit apk. But how do you use that function and where do you add your own apk?
10507 said:
It has a function to edit apk. But how do you use that function and where do you add your own apk?
Click to expand...
Click to collapse
it does not have a function to edit apk (correct me if i'm wrong). once you extracted all the files, go into app and add your apk there.
ghostkid2010 said:
let you extract system.img and boot.img from android build, once you extracted all the fill, it will put all the file into a zip file so you can load via CWM
Click to expand...
Click to collapse
In the Build MDJ_FroYo_Revolution_v._2.2_NAND, there is only system.img, no boot.img. How could I have boot.img?
what a usefull tool, thank you!!
VuNhatVan said:
In the Build MDJ_FroYo_Revolution_v._2.2_NAND, there is only system.img, no boot.img. How could I have boot.img?
Click to expand...
Click to collapse
If there's no boot.img, it should still work. all the boot file is already in the system.img
Let me download that build and I can tell you for sure on how to do it.. I smell that a new version of this script will be out..
Yeah it's very much a work in progress, please feel free to attach updated versions... I'll add them to the first post with accreditation
ghostkid2010 said:
If there's no boot.img, it should still work. all the boot file is already in the system.img
Let me download that build and I can tell you for sure on how to do it.. I smell that a new version of this script will be out..
Click to expand...
Click to collapse
Is it work if there is only system.img?
drizztzou said:
Is it work if there is only system.img?
Click to expand...
Click to collapse
with a little bit of editing yes
ghostkid2010 said:
same post from MDJ
Your script works great extracting the .img file. But it's not able to create zip file. Let me edit your script with the missing file/info.
Download this file and put in folder tools;
http://downloads.sourceforge.net/sevenzip/7za920.zip
change this line;
"%LOC%\tools\7z.exe" a "%LOC%\update.zip" "%LOC%\out\*"
to;
"%LOC%\tools\7za.exe" a "%LOC%\update.zip" "%LOC%\out\*"
and it should work. it will create a zip file.
Enjoy
Click to expand...
Click to collapse
can u more detail about "change this line" location ? u mean u have done it already or i have to do it myself ? which file should i edit ?
ikkon said:
what a usefull tool, thank you!!
Click to expand...
Click to collapse
YEAH! Your not kidding man...i was stoked while playing with it...Id also like to know from here...Is there a similar script for SD->NAND bc my favbe ROM has always been CORECells builds of EVO/HD based...Gave me the best batttery of all SD except for the now current NAND builds. So i figure maybe itll be even better on NAND! TAHNKS again so much for your pos t BIRKOFF! ANYone know of the SD->NAND question?
psuser said:
can u more detail about "change this line" location ? u mean u have done it already or i have to do it myself ? which file should i edit ?
Click to expand...
Click to collapse
YOU have to add an "a" after the z in 7z WITHIN the RUNME script...you have to right click it and open with NOTEPAD on PC and add the "a"
psuser said:
can u more detail about "change this line" location ? u mean u have done it already or i have to do it myself ? which file should i edit ?
Click to expand...
Click to collapse
download the new version on page 1, its fixed
Really cool idea!! I gave it a shot, it just reboots after the MAGLDR screen showing the HTC logo over and over until you boot back into recovery. It flashed fine but just wouldn't boot.
VuNhatVan said:
In the Build MDJ_FroYo_Revolution_v._2.2_NAND, there is only system.img, no boot.img. How could I have boot.img?
Click to expand...
Click to collapse
Use the following "RunMetest.bat"
http://hotfile.com/dl/95408413/0c085bd/RunMetest.rar.html
I tested with different build, system.img only, both boot.img and system.img, it was able to create a zip with all the file.
I'm not uploading the whole folder since this was started by birkoffsjunk, I'm just helping
Test it out

[Q] Edit the Ramdisk?

Anyone know how to edit the ramdisk inside the boot.img? Like for example: the boot image from the Particle Android Rom -- when you boot up your phone it says Samsung Galaxy Gio 5660
Is there some way to edit this to make it say 5660m? I believe i has something to do with the ramdisk folder that you extracted from the boot.img
EDIT-------
@UtmostMick0 The dsixda kitchen is not fully for the GIO. So you should expect some probs
----------
No,if you want to change it,you should change Gio.rle
Sent from my GT-S5660 using xda premium
czkwg8 said:
No,if you want to change it,you should change Gio.rle
Sent from my GT-S5660 using xda premium
Click to expand...
Click to collapse
Yup, try to search XDA for ''changing boot splash image''
I'm not in a position to help you out completely, but the others have been largely correct.
The boot.img file contains both the kernel and the ramdisk, there are scripts for both Windows and Linux to unpack and repack the boot.img files.
After that, you'll need to find a command line utility to convert the RLE (gio.rle) file into a RAW Run Length Encoded bitmap image that's going to be compatible with an image editing program of your choice.
Depending on the editing program used, if you want to do color, you may need to swap around your RGB channels in order to get correct results on the phone.
Let me know if you can't find the programs and I'll try to dig them out for you. But you should be able to find them somewhere on XDA.
kewl , someone else is playing with this to atm , lolz , i have used the dsixda kitchen to unpack my boot.img and got the GIO.rle file out of it , my problem is when i put replacement GIO.rle into the boot.img and repack it the wifi doesnt work :-( , any ideas ?
CM 7.2

[Q] Help with building stock kernel

I would like to learn how to build stuff for my tmobile s2. I figured I should try to build the stock kernel first to get my hands dirty. I have been following this guide here: http://forum.xda-developers.com/showthread.php?t=1442870
Unfortunately it is for the Epic Touch 4G, but I think a lot is similar. I have several questions regarding building a kernel for the T989:
1) How can I extract the initramfs from a stock boot.img?
2) The guide from the link above tars a zimage file. Does this need to be boot.img for the T989?
Thanks.
Below I have posted what I have done so far in trying to compile a kernel for the T989, in case anyone else is also learning like me.
I am using Ubuntu 10.10 32-bit
1) Download T989 source code from here: https://opensource.samsung.com/reception/receptionSub.do?method=search&searchValue=SGH-T989 (download the T989 version for TMobile)
2) unzip SGH-T989_GB_Opensource.zip
3) extract SGH-T989_Kernel.tar.gz
4) next you need to get a version of the initramfs. I got it off of my phone using clockworkmod backup (boot.img file) and following this guide to extract the initramfs: http://www.freeyourandroid.com/guide/extract-edit-repack-boot-img-windows
5) Download arm toolchain here (I use version 2010.09): https://sourcery.mentor.com/sgpp/li...09-51-arm-none-eabi-i686-pc-linux-gnu.tar.bz2
6) extract toolchain
7) Setup cross compile script (run before doing compiles) (change CROSS_PATH for your setup):
cross-compile.sh:
BINVERSION=arm-2010.09
export ARCH=arm
export CROSS_PATH=~/android/toolchains/${BINVERSION}/bin/
export CROSS_NAME=arm-none-eabi-
export CROSS_COMPILE=${CROSS_PATH}${CROSS_NAME}
export CC=${CROSS_NAME}gcc
export CXX=${CROSS_NAME}g++
export LD=${CROSS_NAME}ld
export STRIP=${CROSS_NAME}strip
PATH=${CROSS_PATH}:$PATH
8) Compile script (modify CONFIG_INITRAMFS_SOURCE to point to your initramfs) :
source ../scripts/cross-compile.sh
cd kernel
make clean
make mrproper
make msm8660_celox_usa_tmo_defconfig
make modules
make -j5 CONFIG_INITRAMFS_SOURCE=../initramfs
9) The kernel image is in "arch/arm/boot/zimage"
10) *** Question: How do I make the zimage "odin" compatible
This is still not complete (Steps 10 is unsolved). I need to make the build image odin compatible.
If anyone knows of a kernel building guide that exists for the T989 please post here.
Thanks.
You should pm the devs that posted their kernels in the dev section. Im sure they would love to help. Even exchage google talk or google + with each other to get quicker answers.
sent from the Dark §¡3€
I noticed you hit up the e4gt thread so I came here to see If I can help. If you have Irc I can walk you thru It all the way. I lost all my data today so my machine is down for building. im on freenode #evervolv ...
interloper, thanks for the kind offer. Please let me know when your machine is up and running. Hope to hear from you. Thanks again.
This is the script you want to use to extract the initramfs http://forum.xda-developers.com/wiki/Extract_initramfs_from_zImage
It works for the E4GT without modification so it should work for you guys without modification.
dtm_stretch,
Thanks for the extract script. The script does not work when I try to extract the initramfs from a boot.img I got from doing a backup with clockworkmod. It only manage to extract two empty folders: "dev" and "root"
However, the script does work when I tried it on a zImage I built myself. With the kernel I built I used the initramfs provided at: https://github.com/bubby323/anomaly_kernel_platform_SGH-T989/tree/master/initramfs
I know I can use the initramfs at the github but I really would like to learn how to get it myself so I can apply to other phones later. The knowledge is more important to me.
Thanks.
I was able to extract the initramfs from the boot.img (cwm backup of my phone) using the tools at this site: http://www.freeyourandroid.com/guide/extract-edit-repack-boot-img-windows
Now my only problem is making a odin compatible (flashable) kernel from the compiled zImage. Is it as simple as renaming zImage to boot.img and then put it in a tar to flash with odin? The only reason why I am not certain is my zImage is only about 5megs while the boot.img is 10megs. It seems like the boot.img is a disk copy of the flash partition for the boot on the phone. Do I need to use dd to copy my zImage into boot.img?
I know I make no sense. Hopefully with this last step I have it all down (at least for creating a kernel, rom is next). Please help a noob. Thanks.
datzstr8 said:
I was able to extract the initramfs from the boot.img (cwm backup of my phone) using the tools at this site: http://www.freeyourandroid.com/guide/extract-edit-repack-boot-img-windows
Now my only problem is making a odin compatible (flashable) kernel from the compiled zImage. Is it as simple as renaming zImage to boot.img and then put it in a tar to flash with odin? The only reason why I am not certain is my zImage is only about 5megs while the boot.img is 10megs. It seems like the boot.img is a disk copy of the flash partition for the boot on the phone. Do I need to use dd to copy my zImage into boot.img?
I know I make no sense. Hopefully with this last step I have it all down (at least for creating a kernel, rom is next). Please help a noob. Thanks.
Click to expand...
Click to collapse
Sorry for not replying sooner, but if you want to create a flashable tar in terminal
Code:
# cd /where/your/zimage/is/located
# tar cvf whateveryouwanttocallyourkernel.tar zImage
or you can just use a zip that already flashes a kernel and swap out the zimages.
I was able to successfully build my kernel and flash it to my phone. I needed to use mkbootfs and mkbootimg to combine my zImage and ramdisk to make boot.img. I will post a tutorial up in the development section and will link it here when I am done. Hopefully it will help all the noobs like me get their feet wet. Stay tuned.
update:
here is the link to the guide: http://forum.xda-developers.com/showthread.php?p=22941057#post22941057
ODIN .tar
I advise all of you to learn bash scripting. With bash scripting or pearl you can automate this entire process. Also create a cheat sheet text document with long but common commands, git command reminders and things like that. These commands should create your ODIN .tar file. First cd to the directory the junk is in then:
Code:
tar -H ustar -c factoryfs.rfs cache.rfs modem.bin zImage boot.bin recovery.bin param.lfs sbl.bin > myOdin.tar
That makes the tarball
Then:
Code:
md5sum -t myOdin.tar >> myOdin.tar
That does the MD5 sum
Then:
Code:
mv myOdin.tar myOdin.tar.md5
That sign the tarball with the MD5 sum
You should be able to ODIN that .tar. Now, for the first command you can replace whatever files you want tarred with what I put. If you only want the modem.bin specify that only, etc.
Another word of advice is to find helpful helpful Nautilus scripts to ad to the right click context menu for time saving simple operation. Google it and you find several good resources. Also, if you look, there are Nautilus scripts that can be added to zip and sign .zip and .apk files to make that faster and easier.
Be careful out there and good luck.

Categories

Resources