[Q] Could CWM be installed via an ADB-script? - Galaxy S II Q&A, Help & Troubleshooting

I've see the amazingly simple rooting method by DooMLoRD (ZergRush) listed here:
http://forum.xda-developers.com/showthread.php?t=1321582
And I'm wondering if something like that could be done for, once you have root, install CWM.
This would be interesting as it would add a new way to get CWM other than flashing some CWM-containing kernel or using the terrifying Rom manager app...
I am not sure if it would be so simple as DooMLoRD's script since CWM doesn't seem to be an "app" like su / busybox...
What do you think?

Genrauser said:
I've see the amazingly simple rooting method by DooMLoRD (ZergRush) listed here:
http://forum.xda-developers.com/showthread.php?t=1321582
And I'm wondering if something like that could be done for, once you have root, install CWM.
This would be interesting as it would add a new way to get CWM other than flashing some CWM-containing kernel or using the terrifying Rom manager app...
I am not sure if it would be so simple as DooMLoRD's script since CWM doesn't seem to be an "app" like su / busybox...
What do you think?
Click to expand...
Click to collapse
Your best bet at attempting this would be using Heimdall. From the help file:
Code:
7. Use the instructions to manually enter a command with all the files you want to flash.
Here is an example that does a full flash and repartition on a GT-I9000:
heimdall flash --repartition --pit s1_odin_20100512.pit --factoryfs factoryfs.rfs --cache cache.rfs --dbdata dbdata.rfs --primary-boot boot.bin --secondary-boot Sbl.bin --param param.lfs --kernel zImage --modem modem.bin
NOTE: The above command assumes the files specified are installed in the same directory as Heimdall.
Simply grab a CWM kernel, extract so you have the zimage then heimdall flash --kernel zImage. It would be easy enough to setup a .bat file to give you a few options/menus like the one in your link. Note that this requires the device to be in download mode and I can't imagine any other safe or even possible ways apart from download mode using odin/heimdall or flashing a zip via a custom recovery. Considering that you either have to be in download mode/recovery it seems a little counter productive to go to the extra effort of extracting images or using a command prompt but the above should work.

Genrauser said:
This would be interesting as it would add a new way to get CWM other than flashing some CWM-containing kernel
Click to expand...
Click to collapse
As the recovery mode is part of the kernel, you HAVE TO flash a kernel that contains CWM if you want to use CWM.
THAT however can be done via ADB, yes.
Code:
adb push zImage /sdcard/zImage
adb shell su -c dd if=/sdcard/zImage of=/dev/block/mmcblk0p5 bs=4096

I see.. so what I was thinging is not possible
As you both says, you need to flash a kernel whatsoever.. so the stardart way is much faster than having to extract the zimage and then flash it via adb on download mode (this is the problem, if it could be done on normal mode like that rooting method via adb, getting the zimage and then applying it whenever would be awesome.. but as far as you say it is not ).
Well, really a shame. Thanks both for your help on this!

For what I posted above, you do not need to go into download mode.
If your phone is rooted it works from "normal" mode (i.e. the system running).
You could also check out my little kTool (see sig), that allows you to dump the current kernel or flash a zImage from /sdcard (and a few more things).
The choice of kernels containing is huge for our beloved S2, from ones being very close to original stock down to totally custom ones.

Okay, my bad then, since you didn't elaborate more I implyied you agreed with Hollow.Droid on the "only download mode" subject.
So you actually can change the entire zImage for the CWM with the phone on normal mode... it woud be from the CWM only, not the entire kernel right? Because if a new entire kernel is needed we are on the same stuff again, then its faster to just flash the file via odin and go on.
Otherwise, it would be as simple as getting the CWM's zImage from somewhere and then add it to the phone via adb whenever..

CWM is part of the kernel, the zImage contains the kernel that contains the CWM.
You can not "install CWM" without flashing a whole kernel zImage, the "zImage" *is* the kernel, not only some CWM files.

Okay thanks, sorry for the late answering.
Then I have to flash a new kernel anyway, so it's just faster to do it via odin rather than extracting a zimage and then having to connect, config adb incase you didn't before, etc.
Thanks a lot for your time!

Related

Compile Kernel Issue (zImage Won't Flash)

I'm having trouble flashing a kernel. I've compiled the 2.3.4 kernel (faux's kernel, and i'm using ken's 2.3.4 ROM) and i am trying to fastboot the resulting zImage to my device with no luck. i keep getting either an error, or no action at all.
using the below command, the image is sent, bootloader mode, but just sits there forever.
Code:
fastboot boot zimage zImage
and below just gives an error such as FAILED: 0x30003000.
Code:
fastboot flash zimage zImage
i've searched the forum and see talk about needing the ramdisk, but i'm new to that. my nexus one i was able to just flash the zimage directly after compile with no ramdisk with it.
however i did give the ramdisk a shot. i took my nand backup, pulled the boot.img from it. then broke that up with an extract perl script i found from google, got the resulting ramdisk, which actually looked like the same size as the HKTW ramdisk, both at 152kb. but alas, i just get a boot loop when i use the ramdisk with the following command:
Code:
fastboot flash:raw boot zImage ramdisk.gz
so i'm kinda stuck here and hope someone could give me a pointer. thanks!
i had this while trying to flash xoom's kernel
Sent from my MB860 using XDA App
interesting so you think there is no solution and it has something to do with tegra devices? i can't imagine it's impossible else how are we making custom ROMs!
anyone else have hints? i doubt recovery matters, but i'm using CWM. i even tried wiping dalvik cache before the flash. since fastbooting a kernel doesnt use recovery but the bootloader, recovery prob does not matter either way.
anyone have the ramdisk they could send me? i'm using 2.3.4 ken's ROM. maybe i just goofed on extracting the ramdisk myself.
anyone have any additional advice or tips on the kernel zimage and flashing it to the atrix? i'm at my wits end here. i've tried for 5 days everything i could think of and just CANNOT flash the kernel that i compiled.
i also compiled it about 30 times thinking something screwed up. but seems like i just cant flash it to device. thanks.
use cwm? thats how I flashed the kernel. went perfectly.
also, are you unlocked?
Stephen Who said:
use cwm? thats how I flashed the kernel. went perfectly.
also, are you unlocked?
Click to expand...
Click to collapse
Well this is a zimage because I compiled the source and that's what's giving me trouble flashing to the phone.
I'd have to bundle into a flashable zip to use CWM and I need the ramdisk to do that.
Yes I'm unlocked.
Movd to proper section
Here is a (roundabout) way:
Not sure if you found an answer - but here is a roundabout way:
Start with an existing CWM kernel zip file and extract the boot image off it. Then follow the instructions here:
http://forum.xda-developers.com/showthread.php?t=443994
to get the ramdisk from the image.
Now - since you compiled your own kernel, assuming you know your way around Linux - you might need to adapt the command to match your linux installation, paths, etc.
Also - You might want to use moto-fastboot instead of the stock android fastboot:
Code:
sudo moto-fastboot flash:raw boot zImage mynewimage.img-ramdisk.cpio.gz
where zImage is the zImage compiled by you, and the ramdisk.cpio.gz is the ramdisk you extracted. This is how I load my own kernels onto my Atrix - and has worked for me. I just use a standard ramdisk image - makes life easier
Cheers.

[Q] flash_image file

So I am looking to flash a recovery image without RomMangaer from the device itself.
Should not be a issue since I can use flash_image to flash it, but ofc my ROM does not have it.
I found this thread here: http://forum.xda-developers.com/showthread.php?t=902493 that has a flash_image file attached to it...
My question is, can I use that flash_image file, even though that is in the G2 forum or do I need one built for the tbolt specifically? If I do can someone please link to it.
TIA.
It is ok to answer, I won't bite.
You need to grab the correct recovery file. Probably easiest to use Revolution to do this.
Sorry.... Revolutionary.
Look here as well.
http://forum.xda-developers.com/showthread.php?t=1179386
arbrouwer said:
You need to grab the correct recovery file. Probably easiest to use Revolution to do this.
Click to expand...
Click to collapse
arbrouwer said:
Sorry.... Revolutionary.
Click to expand...
Click to collapse
arbrouwer said:
Look here as well.
http://forum.xda-developers.com/showthread.php?t=1179386
Click to expand...
Click to collapse
Hi, I am not looking for a recovery file, I have CWMR already installed. I am looking for a flash_image file, so I can use a command such as flash_image recovery recovery.img if I wanted.
Thanks for trying.
Sounds like you want to run adb commands, not my specialty. Why not grab the appropriate img file and flash through hboot or clockwork.
http://rootzwiki.com/forum/11-thunderbolt/
MordyT said:
Hi, I am not looking for a recovery file, I have CWMR already installed. I am looking for a flash_image file, so I can use a command such as flash_image recovery recovery.img if I wanted.
Thanks for trying.
Click to expand...
Click to collapse
If you're meaning system partitions, you have to make those yourself through using dd and some mounting on linux.
http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
http://www.slatedroid.com/topic/5799-repack-systemimg/
http://wiki.archosfans.com/index.php?title=Dump_your_Home_Tablet_rom_and_create_a_custom_rom
http://www.androidtablets.net/forum...notes-modifying-system-partition-desktop.html
Someone also JUST ASKED this on the same page of the q/a and got an answer. No one ever reads previous posts anymore
If you mean flashing recovery you have to grab it from the clockwork mod site and flash it using fastboot.
http://android-dls.com/wiki/index.php?title=Fastboot
arbrouwer said:
Sounds like you want to run adb commands, not my specialty. Why not grab the appropriate img file and flash through hboot or clockwork.
http://rootzwiki.com/forum/11-thunderbolt/
Click to expand...
Click to collapse
I do want to run adb commands - a very specific one - on the phone. The adb command is called "flash_image - such as flash_image boot boot.img.
I will be able to flash different partitions without the need of a PC. The only thing is, while a ASOP rom will have the flash_image command (and file called flash_image) a ROM like the one I am on (or even a stock rom) won't. So I need the file... The link I posted in the op has a flash_image file at the bottom, but I don't know if it works for thunderbolt since it is in a g2 forum...
yareally said:
If you're meaning system partitions, you have to make those yourself through using dd and some mounting on linux.
http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
http://www.slatedroid.com/topic/5799-repack-systemimg/
http://wiki.archosfans.com/index.php?title=Dump_your_Home_Tablet_rom_and_create_a_custom_rom
http://www.androidtablets.net/forum...notes-modifying-system-partition-desktop.html
Someone also JUST ASKED this on the same page of the q/a and got an answer. No one ever reads previous posts anymore
If you mean flashing recovery you have to grab it from the clockwork mod site and flash it using fastboot.
http://android-dls.com/wiki/index.php?title=Fastboot
Click to expand...
Click to collapse
Actually, I was not asking that. I know how to make them and all. Do you see my low post count? It is because I read and read and read. Thanks for the advise though.
While I am asking about flashing recovery, I was not asking about hwo to do it in fastboot - I was asking how to do it on the device itself. Without ROM Manager.
In fact, I already know how to do it on the device itself... I need to use the command flash_image recovery recovery.img... except I am missing flash_image on my current ROM... so does anyone know where a version of that file is that is compatible with our tbolts?
MordyT said:
I do want to run adb commands - a very specific one - on the phone. The adb command is called "flash_image - such as flash_image boot boot.img.
I will be able to flash different partitions without the need of a PC. The only thing is, while a ASOP rom will have the flash_image command (and file called flash_image) a ROM like the one I am on (or even a stock rom) won't. So I need the file... The link I posted in the op has a flash_image file at the bottom, but I don't know if it works for thunderbolt since it is in a g2 forum...
Actually, I was not asking that. I know how to make them and all. Do you see my low post count? It is because I read and read and read. Thanks for the advise though.
While I am asking about flashing recovery, I was not asking about hwo to do it in fastboot - I was asking how to do it on the device itself. Without ROM Manager.
In fact, I already know how to do it on the device itself... I need to use the command flash_image recovery recovery.img... except I am missing flash_image on my current ROM... so does anyone know where a version of that file is that is compatible with our tbolts?
Click to expand...
Click to collapse
I dont look at post counts, they're deceiving anyways (and join dates).
Without rom manager? Who does it with that anyways (it's prone to issues)? You flash them in recovery. The commands you use to install something in recovery, if you wish to do it with adb in recovery instead of pressing the buttons are located here http://www.londatiga.net/it/how-to-create-android-update-zip-package/
And yes, you can flash stuff very well in fastboot as well, which is what it looks like you're trying to do by your command you listed. If you're not doing it in fastboot or recovery, you're just crazy and looking to screw something up. You can't do it elsewhere because it'll potentially break your phone.
When you named something recovery.img it makes it look like you're trying to flash a new version of recovery though and that is something you do in fastboot.
That file you wanted anyways, flash_image, just pull it out of another ROM. If it's not in there, then it's part of flashing a new recovery itself.
yareally said:
I dont look at post counts, they're deceiving anyways (and join dates).
Without rom manager? Who does it with that anyways (it's prone to issues)? You flash them in recovery. The commands you use to install something in recovery, if you wish to do it with adb in recovery instead of pressing the buttons are located here http://www.londatiga.net/it/how-to-create-android-update-zip-package/
And yes, you can flash stuff very well in fastboot as well, which is what it looks like you're trying to do by your command you listed. If you're not doing it in fastboot or recovery, you're just crazy and looking to screw something up. You can't do it elsewhere because it'll potentially break your phone.
When you named something recovery.img it makes it look like you're trying to flash a new version of recovery though and that is something you do in fastboot.
That file you wanted anyways, flash_image, just pull it out of another ROM. If it's not in there, then it's part of flashing a new recovery itself.
Click to expand...
Click to collapse
ROM Manager has its flaws. I can't flash boot.imgs in it, I can't flash custom recoverys (not cwm) in it, or any other partition I want....
I am not flashing in fastboot or recovery, or even using a PC. Call me crazy if you will but it is how I roll. The non-need of a computer is what I am after.
See this thread. What I am trying to do is something that can be done since day 1 with android..
http://forum.xda-developers.com/showthread.php?t=902493
http://www.clockworkmod.com/rommanager you can probably pull what you want out of the clockwork recovery image or rom manager.apk. Either mount the recovery image on linux or open up rom manager's apk with a zip program and pull it out.
EDIT: flash_image is in the rom_manager apk. Just get it out of that at the link above.

[KERNEL] About flashing kernel for all Roms

Hi,
Because i like to test many different Roms with kernels, i created my own script to flash properly with the recovery.
Often, the Kernels are available for a Rom in particular, in a zip file containing a boot.img with the kernels modules contained in /system/lib/modules
The problem is that to start, Android does not need that kernel, but also the image of a micro file system (zImage) containing startup instructions, but also a list of parameters to pass to the kernel.
The boot.img is the concatenation of the kernel with its startup parameters, and zImage.
To properly replace a kernel, so we need to retrieve the current settings, the current zImage, and reform the boot.img with the new kernel, and of course, replace the modules.
This recovery script make these step:
- Extract the kernel from the boot.img file
- Get the boot parameters of actual kernel.
- Get the actual zImage
- Rebuild the boot.img with new kernel, old boot parameters, old zImage
- Replace the modules in /system/lib/modules
- Flash the new boot.img
Before do that.
Download the kernel from other Rom, you want to flash
Extract from the zip file, boot.img and /system/lib/modules directory
Get my kernel_flash.zip
Extract it.
Replace the system/lib/modules content with the new one.
Replace the boot.img with the new one.
Rebuild you zip file with 7zip (www.7zip.org)
This zip file containing:
META-INF
boot.img
kernel
system
version.txt
And flash it under recovery.
I tested these method with Senses Roms, with AOKP or AOSP Roms. Always in my system started succefully.
You should be able to flash this kernel on any ROM (except the boot stock that has an offset of 256 bytes incompatible with the script)
As is, this kernel_flash.zip file contains a yoda kernel 2.1, overclocked to 1.5 Ghz, you can test with your ROM.
Sorry for my english.
Thank you to Google for translation assistance
Thank you for the kernel to yoda (my kernel_flash.zip contain 3.0.16-yoda_v2.1)
Thank you to all XDA developers who allowed me to further my understanding
looks promising, but does this work also for s-on users ? i dont know if you knew this already, but there is https://play.google.com/store/apps/details?id=com.joeykrim.flashimagegui&hl=en this app in playstore, which works for both s-on and s-off users, and also flashes recovery
gav-collins1983 said:
looks promising, but does this work also for s-on users ? i dont know if you knew this already, but there is https://play.google.com/store/apps/details?id=com.joeykrim.flashimagegui&hl=en this app in playstore, which works for both s-on and s-off users, and also flashes recovery
Click to expand...
Click to collapse
For s-on:
After flashing kernel under recovery, only /system/lib/modules files are copied
Keep in Recovery,
You need to flash the kernel with fastboot.
Open a terminal
with adb, pull the boot image:
Code:
adb pull /tmp/newboot.img boot.img
Restart in fastboot mode
Code:
adb reboot bootloader
Flash the boot.img file
Code:
fastboot flash boot boot.img
fxjumper said:
For s-on:
After flashing kernel under recovery, only /system/lib/modules files are copied
Keep in Recovery,
You need to flash the kernel with fastboot.
Open a terminal
with adb, pull the boot image:
Code:
adb pull /tmp/newboot.img boot.img
Restart in fastboot mode
Code:
adb reboot bootloader
Flash the boot.img file
Code:
fastboot flash boot boot.img
Click to expand...
Click to collapse
would it flash the kernel if you are using 4ext recovery ?
Pacattack said:
would it flash the kernel if you are using 4ext recovery ?
Click to expand...
Click to collapse
My phone is S-OFF
4ext recovery flash the kernel.
I know 4ext dispose a S-ON mode to flash the boot.img on the first boot, but i don't know if it works in this case.
Try it

Can't boot into recovery after flashing the recovery image

Hi!
I have a problem with a I9100. I follow the instructions on CyanogenMod wiki for flashing the recovery, but something went wrong.
I used heimdall 1.4.0 in GNU/Linux and execute
Code:
sudo heimdall flash --kernel zImage --no-reboot
All worked well and the blue progress bar appears on the screen. When it finished, I tried to enter recovery using the VolUp+Home+PowerUp buttons combination, the Samsung Galaxy S2 logo appears on the screen but it is stuck on this screen.
I tried to re-download the zImage file (using another link, different from the CM wiki one, but the same happened.
Is there an easy way to reboot into recovery from Heimdall, like with fastboot on other devices?
Is possible to install a recovery in another way?
Best regards and thanks in advance
Lk2 said:
Hi!
I have a problem with a I9100. I follow the instructions on CyanogenMod wiki for flashing the recovery, but something went wrong.
I used heimdall 1.4.0 in GNU/Linux and execute
Code:
sudo heimdall flash --kernel zImage --no-reboot
All worked well and the blue progress bar appears on the screen. When it finished, I tried to enter recovery using the VolUp+Home+PowerUp buttons combination, the Samsung Galaxy S2 logo appears on the screen but it is stuck on this screen.
I tried to re-download the zImage file (using another link, different from the CM wiki one, but the same happened.
Is there an easy way to reboot into recovery from Heimdall, like with fastboot on other devices?
Is possible to install a recovery in another way?
Best regards and thanks in advance
Click to expand...
Click to collapse
try 'Odin flash' of a recovery file from a windows Pc and see
Thanks for your answer.
I tried to flash the TAR package with zImage inside from Odin, and same result.
I tried to flash a stock ROM with Odin, and it gives me a non-readable error (a lot of []).
I tried to decompress the stock ROM and flashing with heimdall:
Code:
sudo heimdall flash --primary-boot boot.bin --cache cache.img --factoryfs factoryfs.img --hidden hidden.img --modem modem.bin --param param.lfs --secondary-boot Sbl.bin --kernel zImage --no-reboot
And it fails (primary-boot not recognized):
Beginning session...
Session begun.
Downloading device's PIT file...
PIT file download successful.
ERROR: Partition name for "primary-boot" could not be located
Ending session...
Releasing device interface...
Re-attaching kernel driver...
Click to expand...
Click to collapse
Any idea?
Type this in android terminal emulator:
Su
Reboot recovery
Send from my SGS2 I9100 with HassanROM and latest DorimanX 8.xx kernel
I can't do "reboot recovery" from Android Terminal because I have another issue (read bellow)
Something went wrong with Heimdall. After all, using Odin I was able to boot into recovery mode and flash the ROMs, but when I tried to reboot in "normal mode" I got a "kernel panic upload mode rst_stat=0x200000000" screen.
I did a little research and it appears to be mandatory to flash a stock ROM and begin again with all the process.
I tried it, with the latest stock ROM for my country and company, but Odin return an extrange error when I press in "Start" button. The popup Windows puts the filename and a lot of "squares" (character with a different encoding, like chinese).
EDITED: I was able to flash the stock ROM, but the phone still doesn't boot. The yellow triangle disappeared but it cannot but
What can I try next?

How to use ramdisk extraction utility to flash TWRP

Hey guys,
I consider myself pretty switched on but I can't understand how exactly the " ramdisk extraction utility" is used to flash TWRP.
Correct me if I'm wrong but it is used to unpack a boot.img file into separate files, one of which is the recovery. It then repacks it and allows it to be flashed via "fastest flash boot boot.img"
Ive found tools that repack boot.img files but all appear to be for Linux.
Can someone assist me by guiding me to a tutorial or offer step by step instructions on flashing TWRP onto my z2?
Basically all I want to do is understand how to flash any recovery I want when running a custom rom.
P. S - can someone explain the concept of why it dosnt work when I try to install TWRP as described in their website with
*terminal emulator or in adb shell:
su
dd if=/sdcard/fotakernel.img of=/dev/block/platform/msm_sdcc.1/by-name/FOTAKernel
Thank you.
Nothing guys?
Im not sure how to help you
1. Install fastboot
2. Use fastboot to flash recovery
Fastboot flash recovery recovery.img
3. You need a custom kernel
4. Find a kernel that supports fotakernel(recovery partition fyi)

Categories

Resources