I have compiled a custom Kernel for my HTC Desire 200 unit from htc's source. After my kernel is compiled i get a zImage file. I then use Android Image Kitchen, to take a standard boot.img file and unpack it, replace the original zImage in it, repack and flash it via the fastboot command: "fastboot flash boot boot.img"
Fastboot then flashed the kernel, i reboot the phone and it boots and works to some extend. The changes i make is there (as an example, i can see the name change i have made in the kernel version), however WiFi is not working on the device with this custom kernel, and i believe this is because i need to somehow install the devices needed modules along with the kernel.
And heres my question. How can i create a zip file, that i can flash from Clockwork Mod recovery, that flashes the kernel, along with placing the modules where they belong? OR bundle the modules with a boot.img file that i can flash from fastboot ?
Basicly what i have i a zImage and modules, but i need to bundle it together for easy flash either via recovery (zip) or fastboot (img)
Can you assist me?
Quite surprised that this seems unsolvable yet also seems to be a thing every kernel developer has been dealing with ..
Related
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.
SOLVED thank you joeykrim
i did the fastboot method below. and just a note for anyone with the same problem, the "command" will vary depending on the location you have the rom's zip file (also unzip to gain easier access to the boot.img file. so the command is "fastboot boot <path to the boot.img file>
i just flashed the 3d synergy nightly build rom to my 3d, but the wifi will not turn on. it simply says error.
what can i do to fix this?
i have read that there is something to do with my kernal, but im not positive what.
evo3d-rooted with htc unlock method
Kernal-2.6.35.13-g84f8edd [email protected] #1 (ie stock, i have not flashed anything other than clockwork and the rom.)
3rdsurfer said:
i just flashed the 3d synergy nightly build rom to my 3d, but the wifi will not turn on. it simply says error.
what can i do to fix this?
i have read that there is something to do with my kernal, but im not positive what.
evo3d-rooted with htc unlock method
Kernal-2.6.35.13-g84f8edd [email protected] #1 (ie stock, i have not flashed anything other than clockwork and the rom.)
Click to expand...
Click to collapse
The WiFi error is caused by a mismatch between the WiFi module and the currently loaded kernel. The WiFi module is stored in /system/lib/modules/bcm4329.ko . The kernel is stored in the boot partition.
When booted into the custom recovery through the traditional methods, reboot recovery, bootloader -> recovery, etc., HTC unlock method does not unlock *kernel* write access but does unlock *system* write access.
The result is the kernel module for WiFi is loaded but the kernel itself is not loaded. This creates a mismatch between a WiFi module loaded from the ROM and the matching kernel not being loaded as HTC does not allow it to be loaded from the traditional recovery boot method.
The main issue around kernel write access is due to the HTC unlock method only allows kernel write access in two modes:
1) Booted in normal Android mode. My application, Flash Image GUI, will flash any kernel .zip file with the HTC unlock method because it runs in normal android mode. HTC unlocks write access to the boot partition, where the kernel is stored, in normal Android mode. Flash Image GUI also properly loads the respective WiFi modules essentially eliminating this WiFi mismatch error.
2) Fastboot booted into the custom recovery using the following command: fastboot boot c:\android\cwm-recovery.img. HTC unlock method allows kernel write access while using fastboot boot of a custom recovery.
Hope that helps!
Edit: If you're curious and want to do some reading on previous WiFi error issues with the EVO 3D here are some similar posts:
http://forum.xda-developers.com/showpost.php?p=17681402
http://forum.xda-developers.com/showthread.php?p=16990247
http://forum.xda-developers.com/showpost.php?p=18624865
http://forum.xda-developers.com/showthread.php?t=1265467
sorry, im less smart than i thought... what do i need to do? reflash the entire rom, flash a new kernal, or something else
3rdsurfer said:
sorry, im less smart than i thought... what do i need to do? reflash the entire rom, flash a new kernal, or something else
Click to expand...
Click to collapse
Essentially there are three options:
1) Flash a custom kernel through Flash Image GUI which will load the custom kernel and the respective modules allowing WiFi and WiMAX to work properly.
Or similar to option #3, extract the boot.img from the ROM and flash this through Flash Image GUI.
2) Fastboot boot the custom recovery which will then properly flash both the ROM and the kernel at the same time properly. command: fastboot boot c:\android\cwm-recovery.img.
3) Flash the ROM through the custom recovery (booted traditionally), then pull out the boot.img file from the ROM and manually flash through fastboot. command: fastboot boot c:\rom\boot.img
Hope that helps clarify the options along with the commands to have them work properly!
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
Sorry what boot.img it should say, I knew I'd got it wrong
Ive just rooted my HOX+, do I need to flash a BOOT.img before flashing InsertCoin 3.8.2, it doesn't say anything about flashing a Boot.img, or am I ok to flash InsertCoin 3.8.2 straight onto the phone?
I want to install InsertCoin 3.8.2, and maybe try Viper later. Is there a boot.img I can flash for both these roms assuming I need to.
open the zip file then find the boot.img extract it to your desktop then download the fastboot / adb put the boot.img inside the folder, connect you phone via fastboot to your compuetr then flash the boot.img. Ithnks there is a good tutorial on the general section, just check it to understand more about flashing
Jonnibravo said:
Sorry what boot.img it should say, I knew I'd got it wrong
Ive just rooted my HOX+, do I need to flash a BOOT.img before flashing InsertCoin 3.8.2, it doesn't say anything about flashing a Boot.img, or am I ok to flash InsertCoin 3.8.2 straight onto the phone?
I want to install InsertCoin 3.8.2, and maybe try Viper later. Is there a boot.img I can flash for both these roms assuming I need to.
Click to expand...
Click to collapse
boot.img has to be flashed fastboot, like recovery, with "fastboot flash boot <boot_img_name>.img" command. Or you can use hasoon2000's All-In-One kit to do so.
If you want a kernel which works for multiple sense roms, you should try EliteKernel OXP by nik3r or hXore Kernel by bedalus should also work (if i understood right). They should work for all Sense roms based on 1.17.401.1, i don't know whether they work on 1.17.401.3.
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)