Hi all,
I am trying to rebuild the stock Froyo kernel on my Droid. I found the exact git version used as the stock kernel, and built the kernel with:
Code:
make sholes_defconfig LOCALVERSION=-g68eeef5
To the best of my understanding, that is the configuration file used.
I packaged the kernel with:
Code:
./mkbootimg --kernel omap/arch/arm/boot/zImage --ramdisk boot.img-ramdisk.gz --cmdline "console=ttyS2,115200n8 rw [email protected] init=/init ip=off brdrev=P3A_CDMA mtdparts=omap2-nand.0:[email protected](mbm),[email protected](cdt),[email protected](lbl),[email protected](misc),3584k(boot),4608k(recovery),143744k(system),94848k(cache),268032k(userdata),2m(kpanic)" -o boot.img
Then I flash the kernel image like the following:
Code:
flash_image boot /sdcard/boot.img
However, after the system boots and I get to my desktop I get the error:
Code:
Sorry! Process system is not responding.
I have compared the dmesg of booting the stock kernel and my rebuild of the kernel, found here:
http://www.ece.cmu.edu/~gnychis/diff.html
The one thing I am afraid of is around line 490,491 and some differences there after. Does anyone know what might be missing in my kernel configuration for those? I was pretty positive this was the exact configuration used, but maybe not. Has anyone had a problem like this trying to build a custom ROM?
Thanks!
solved... my boot.img-ramdisk.gz did not properly match. I extracted boot.img from the stock rom and paired my kernel with it.
Related
Hi, I am trying to compile my own kernel, using the CM7.1 alpha source, but have not been able to load the zImage successfully. So I have taken a step back and tried to create a boot.img with an existing working 1.
I've extracted the boot.img from the file: update-cm-7.1.0-SelfKANG10-Sensation-signed.zip and have been able to fastboot boot boot.img using the extracted file. Everything loads up fine.
I would like to simply unpack this img and repack it with no modifications. I have tried several methods:
split_bootimg.pl, then, (have also tried other scripts unpack-H.pl, unpack-bootimg.pl, unpack.sh)
mkbootimg --cmdline 'no_console_suspend=1 console=null' --kernel your-kernel-file --ramdisk newramdisk.cpio.gz -o mynewimage.img
fastboot boot mynewimage.img
The phone hangs at the HTC boot screen.
I have tried manually separating the kernel and ramdisk using a hex editor, finding the string 00 00 1F 8B and removing the bottom section to get the kernel and the top section to get the ramdisk, then creating 2 separate files.
I have also tried adding the base address 0x40400000 to the mkbootimg command.
Is there something else I am missing? Please help. I have Sensation 4G if that makes any difference.
bump. anyone can point me in the right direction?
Found my problem. Base address in the config file was wrong. It showed 0x40400000. I used a new split script that displays the base address which shows 0x48000000. Did the mkbootimg with a split boot.img of a working CM7.1 update and the new boot image is now working. Will try with compiled zImage now.
Simma87 said:
Found my problem. Base address in the config file was wrong. It showed 0x40400000. I used a new split script that displays the base address which shows 0x48000000. Did the mkbootimg with a split boot.img of a working CM7.1 update and the new boot image is now working. Will try with compiled zImage now.
Click to expand...
Click to collapse
Let's me kwown method of u? Thank
good advice guys.. thanks
I have a xoom wifi with android 3.2 on it. Kernel [email protected] #1
I'm rooted and my bootloader is unlocked. I downloaded the Timate kernel (Tiamat-Kernel-2.0.0-Katana-stockgpu.zip) and loaded it with clockwork recovery. I saw anykernel run when I applied the zip. But after I reboot the xoom still has the same kernel version on it.
Did I miss a step somewhere? How does it keep loading the stock kernel after I load the new one? The only thing I can think of is that there is a failsafe mode that loads the "last good" kernel if the current one fails.
njdevi11 said:
I have a xoom wifi with android 3.2 on it. Kernel [email protected] #1
I'm rooted and my bootloader is unlocked. I downloaded the Timate kernel (Tiamat-Kernel-2.0.0-Katana-stockgpu.zip) and loaded it with clockwork recovery. I saw anykernel run when I applied the zip. But after I reboot the xoom still has the same kernel version on it.
Did I miss a step somewhere? How does it keep loading the stock kernel after I load the new one? The only thing I can think of is that there is a failsafe mode that loads the "last good" kernel if the current one fails.
Click to expand...
Click to collapse
Do a manual Flash from recovery. or - Upgrade to ICS with -Download the EOS ICS 1.0.0 (good stable ROM/kernel)
http://forum.xda-developers.com/showthread.php?t=1484770
SOLVED:
So for whatever reason I absolutely CAN NOT get an anykernel zip to work for me and i've tried it on a few devices (xoom, nexus s, atrix, nook off the top of my head). Here is what I had to do to get my own kernel on the xoom:
(1) make a backup with CWM, and copy the boot.img to my computer.
(2) extract boot.img with unpack-bootimg.pl
(3) this gives me the boot-img-ramdisk.cpio.gz file and boot.img-kernel.gz
If you want to recpio because you changed the ramdisk/added ko's run:
cd boot.img-ramdisk/
find . | cpio -o -H newc | gzip > ../bootimg-ramdisk.cpio.gz
cd ..
(4) use command:
mkbootimg --cmdline 'androidboot.carrier=wifi-only product_type=w' --kernel zImage --ramdisk boot.img-ramdisk.cpio.gz -o boot-new.img --base 0x30000000 --pagesize 4096
adb reboot bootloader
fastboot flash boot boot-new.img
Adendium:
I figured out what the command= should be by opening a working boot-img in a hex/text editor (vi) and just copied what should be in there. That seems to do that trick for the last few devices i've tried compiling kernels for. All the "tutorials" on the internet I've seen get really sketchy when it comes to actually repacking a kernel and there is a lot of bad or just lazy information that's outdated or copied about one device for another that doesn't actually work like that.
1) download source code from https://opensource.samsung.com/index.jsp. You are looking for source code for SGH-T839.
2) Get initramfs (Need to make a kernel package)
Extract it using extract boot http://www.mediafire.com/?lc12eceeh617b97.
This is why I am looking for a boot.img
extract it
Code:
tar -xvf extractboot.tar.gz
now move into directory with extract boot and copy your boot.img into here and do
Code:
./extractboot boot.img
3) Get mkboot tools
http://www.mediafire.com/?w06d1m6n1dgo4op
untar it by doing
Code:
tar -xvf $FILENAMEHERE
Add the bin directory to your path by moving to the bin directory and copying down the path then
Now you will add this to your path by editing your .bashrc file.
Go to your bashrc file
Code:
gedit ~/.bashrc
and adding this
Code:
PATH=$PATH:/FULLDIRECTORYYOUWROTEDOWN/
export PATH
4) Download the ARM toolchain
https://sourcery.mentor.com/sgpp/lite/arm/portal/package5385/public/arm-none-linux-gnueabi/arm-2009q3-67-arm-none-linux-gnueabi.bin
and
https://sourcery.mentor.com/sgpp/lite/arm/portal/package5355/public/arm-none-eabi/arm-2009q3-68-arm-none-eabi.bin
5) Install the ARM Toolchain
create the directory /opt/toolchains/arm-2009q3/
Code:
sudo mkdir /opt/toolchains/arm-2009q3/
then install the toolchain using /opt/toolchains/arm-2009q3/
as the install directory
Code:
sudo chmod +x arm-2009q3-68-arm-none-eabi.bin
sudo chmod +x arm-2009q3-67-arm-none-linux-gnueabi.bin
sudo ./arm-2009q3-67-arm-none-linux-gnueabi.bin -i console
sudo ./arm-2009q3-68-arm-none-eabi.bin -i console
6) Compile
Extract your source code and go to the directory Kernel and do the following
WARNING: MAKE SURE THERE ARE NO SPACES IN YOUR FILEPATH BECAUSE THE MAKEFILE DOESNT LIKE THEM.
Code:
make clean
make arch=arm sidekick_rev02_defconfig
make ARCH=arm HOSTCFLAGS="-g -O3" -j8 CROSS_COMPILE=/opt/toolchain/bin/arm-none-eabi-
Now copy any of the resulting compiled ko files into the initramfs file you have extracted and you should have what you need to package a kernel.
you forget initramfs
windxixi said:
you forget initramfs
Click to expand...
Click to collapse
yeah I kept it out so that somebody would post a boot.img then could do steps related to that. I am looking for a boot.img to get initramfs from
unpack zImage
Sent from my SGH-T839 using XDA
---------- Post added at 08:46 AM ---------- Previous post was at 07:49 AM ----------
and how to pack a boot.img?
A request to anyone building SK4G kernels.
Please disable the keystroke logging printk statements in the file:
Code:
drivers/input/keyboard/s3c-keypad.c
The lines look like this:
Code:
//printk("\nkey Pressed : key %d map %d\n",i, pdata->keycodes[i]);
and
Code:
//printk("\nkey Released : %d map %d\n",i,pdata->keycodes[i]);
It is possible to recover the actual keystrokes from the numerical codes those statements log, and the messages go into the dmesg buffer. So it's pretty easy to extract them and determine exactly what the user typed.
In the latest Samsung sources I've seen, those lines were already commented out. It makes sense to enable them while debugging a new ROM build, but please do disable them prior to building a kernel intended for general consumption.
Do you guys know if the available source code will produce a kernel that will work with kj2? the kernel version in SGH-T839_Opensource_Update1 looks to match up, but I compilied a zImage and it didn't boot on stock kj2. but I could very well be missing something.
I have done a small amount of kernel work on an HTC device, but I basically just used the Rom Kitchen to pack up my zImages with a boot.img-ramdisk to create a boot.img. I guess I might need a little more instruction for packing up a Samsung kernel. Is it also an option to just tar up the zImage and flash it with Odin/Heindall?
Thanks for this thread, and for any other advice!
Sent from my SGH-T839 using Tapatalk 2
In case it might be useful to someone else working on building a kernel.
The official and Bali_SK4G sources both seem to insist on building with debug symbols enabled for some of the modules. In particular, i was ending up with dhd.ko being 2.4 MB in size, where it should have been less than 400 KB.
The ideal case would be to determine why the debug symbols are being included -- commenting out the labelled debug options in the bcm4329 Makefile didn't accomplish this.
But a workaround is to strip the modules after the build is finished, before assembling the initramfs.
Has anyone been able to build a working zImage for KJ2 using Dr. Honk's Bali sources [1] and sduvick's KJ2 ramdisk files [2]?
I have been able to build a zImage of a reasonable size (6520 KB). But when I flash this to the KERNEL partition using heimdall, the device boot loops to the B&W Sidekick logo. It doesn't get far enough to show any adb log output.
I can then use the same heimdall flashing procedure to flash the Platypus Egg v1 zImage, or other KJ2-compatible zImage files, and the device boots and works properly.
So I'm trying to figure out what I'm doing wrong in building my zImage. If anyone has any advice I would be appreciative.
[1] https://github.com/drhonk/Bali_SK4G
[2] https://github.com/sduvick/SK4g_KJ2_Ramdisk
I got an updated Bali_SK4G kernel booting using the ramdisk from GenericGinger 2.0.
I have worked up some patches to disable the logging of keystrokes and other more trivial debug spew in dmesg. Also included is a Makefile patch that was required for the compile to complete with my toolchain.
https://carbon.flatlan.net/nxd/patches_Bali_SK4G_nxd.tar.bz2
md5sum: 5d14ac32de155cdca0fd82f14bc4ceca
These patches are GPL licensed, in compliance with the license for the Linux kernel itself. I make no guarantees about their suitability for any purpose. I grant permission to use them to anyone who would like to do so, so long as they comply with the GPL.
I'd like to make a compiled kernel available with these changes, but XDA's rules can be interpreted to mean that I must obtain permission from a series of upstream contributors, some of whom may not be reachable. Perhaps a moderator will clarify the parameters of the permission rule.
This is the stock kernel without system write protection. Completely stock configuration, completely stock ramdisk. The only difference is it allows write to system
Uses Telstra 3.17.841.2 source from htcdev.com:
http://dl4.htc.com/RomCode/Source_and_Binaries/evitaul-jb-crc-3.4.10-240d4d5.zip
Devs who need a vanilla kernel are free to modify or include with ROMs
installer: http://goo.gl/64HJc
boot.img: http://goo.gl/IRZ9m
Does this also uninstall any old modules?
Sent from my VENOMized HoxL
area51avenger said:
Does this also uninstall any old modules?
Sent from my VENOMized HoxL
Click to expand...
Click to collapse
The installer deletes /system/lib/modules/wp_mod.ko and /system/lib/wp_mod.ko
There is no init.d support either, so it won't load any init scripts.
Nice job, this should be useful! :good:
On my side, I had some problems. I have tried to compile the kernel, but I went a little bit further with the modifications:
disabled the /system write protection.
integrated the prima_wlan source tree in drivers/staging. The sources were downloaded from the codeaurora.org site and the driver version was 3.1.7.16 (I have specifically chosen this version because it was the closest to the 3.1.7.0 version that exists in the stock ROM).
compressed the vmlinux image with LZMA instead of gzip (this is an option in the configuration) to obtain the zImage file.
compressed the ramdisk image with LZMA instead of gzip (in the configuration file, I have seen 3 enabled options: gzip, LZMA and XZ and I thought recompressing the ramdisk might not hurt).
The toolchain I have used was downloaded from android.googlesource.com. Then I have unpacked the original boot.img like this: trimmed the first 128 bytes from the file (up to the ANDROID magic label), then used the unpackbootimg tool (this was a tool I have found in a Gingerbread source tree). Then, I have used the new zImg, the LZMA compressed ramdisk and mkbootimg (this was also picked from the same Gingebread source tree) to build a new boot.img. I have booted in the recovery, flashed the new modules, then booted in fastboot mode and flashed the boot.img. The result was an annoying boot loop and it wasn't very easy to put the phone in fastboot mode again.
I have some questions about what I have done so far. Could you, please, tell me if there was a wrong manoeuvre/setting/thingie? I suspect the unpacking process has not produced the proper data (command line, base address ...). What tool have you used to unpack the original boot.img file? I also suspect the packing process. Is a new mkbootimg required?
And some questions about your work. What prima_wlan driver have you used in your boot.img? Have you modified the suffix added to the 3.4.10 version when you have configured the kernel in order to make it work?
AlxMAX said:
On my side, I had some problems. I have tried to compile the kernel, but I went a little bit further with the modifications:
disabled the /system write protection.
integrated the prima_wlan source tree in drivers/staging. The sources were downloaded from the codeaurora.org site and the driver version was 3.1.7.16 (I have specifically chosen this version because it was the closest to the 3.1.7.0 version that exists in the stock ROM).
compressed the vmlinux image with LZMA instead of gzip (this is an option in the configuration) to obtain the zImage file.
compressed the ramdisk image with LZMA instead of gzip (in the configuration file, I have seen 3 enabled options: gzip, LZMA and XZ and I thought recompressing the ramdisk might not hurt).
The toolchain I have used was downloaded from android.googlesource.com. Then I have unpacked the original boot.img like this: trimmed the first 128 bytes from the file (up to the ANDROID magic label), then used the unpackbootimg tool (this was a tool I have found in a Gingerbread source tree). Then, I have used the new zImg, the LZMA compressed ramdisk and mkbootimg (this was also picked from the same Gingebread source tree) to build a new boot.img. I have booted in the recovery, flashed the new modules, then booted in fastboot mode and flashed the boot.img. The result was an annoying boot loop and it wasn't very easy to put the phone in fastboot mode again.
I have some questions about what I have done so far. Could you, please, tell me if there was a wrong manoeuvre/setting/thingie? I suspect the unpacking process has not produced the proper data (command line, base address ...). What tool have you used to unpack the original boot.img file? I also suspect the packing process. Is a new mkbootimg required?
And some questions about your work. What prima_wlan driver have you used in your boot.img? Have you modified the suffix added to the 3.4.10 version when you have configured the kernel in order to make it work?
Click to expand...
Click to collapse
use dsi xda kitchen to pack the boot.img for easy use
or
use this
unpackbootimg -i boot.img -o /directoryfordump
mkbootimg --cmdline 'console=ttyHSL0,115200,n8' --kernel zImage --ramdisk ramdisknew.gz --base 80400000 --ramdiskaddr 81900000 -o newboot.img
Where have you got that ramdisk address from? unpackbootimg doesn't report it.
Zarboz said:
mkbootimg --cmdline 'console=ttyHSL0,115200,n8' --kernel zImage --ramdisk ramdisknew.gz --base 80400000 --ramdiskaddr 81900000 -o newboot.img
Click to expand...
Click to collapse
Edit: I have done some research on mkbootimg and unpackbootimg and their usage is a little bit confusing. The boot image header contains a kernel address, a ramdisk address and some other data (including the command line provided to the kernel by the bootloader). The mkbootimg tool like it is in the Android repository uses more measures: a base address, a kernel offset, a ramdisk offset etc. The kernel address is base + kernel offset and so on. When unpacking the boot image with unpackbootimg, one must suppose one of the parameters fixed, usually the kernel offset (0x00008000). Consequently, the base address is computed as the kernel address - the kernel offset. To conclude, the command line to use should be:
Code:
mkbootimg --cmdline 'console=ttyHSL0,115200,n8' --base 80400000 --ramdisk_offset 1408000 --kernel boot.img-zImage --ramdisk boot.img-ramdisk.gz -o boot-2.img
This produces the same boot.img as the one posted by flar2, except for the command line.
Edit 2: I have recompiled the kernel, disabled the /system protection, used the mkbootimg command line right above and now my phone boots and runs well. The prima_wlan.ko that I have compiled together with the kernel (3.1.7.16 from codeaurora source repository) doesn't work. It might be a matter of wi-fi firmware. Fortunately, the stock prima_wlan.ko (proprietary 3.1.7.0) module works well.
AlxMAX said:
Where have you got that ramdisk address from? unpackbootimg doesn't report it.
Edit: I have done some research on mkbootimg and unpackbootimg and their usage is a little bit confusing. The boot image header contains a kernel address, a ramdisk address and some other data (including the command line provided to the kernel by the bootloader). The mkbootimg tool like it is in the Android repository uses more measures: a base address, a kernel offset, a ramdisk offset etc. The kernel address is base + kernel offset and so on. When unpacking the boot image with unpackbootimg, one must suppose one of the parameters fixed, usually the kernel offset (0x00008000). Consequently, the base address is computed as the kernel address - the kernel offset. To conclude, the command line to use should be:
Code:
mkbootimg --cmdline 'console=ttyHSL0,115200,n8' --base 80400000 --ramdisk_offset 1408000 --kernel boot.img-zImage --ramdisk boot.img-ramdisk.gz -o boot-2.img
This produces the same boot.img as the one posted by flar2, except for the command line.
Edit 2: I have recompiled the kernel, disabled the /system protection, used the mkbootimg command line right above and now my phone boots and runs well. The prima_wlan.ko that I have compiled together with the kernel (3.1.7.16 from codeaurora source repository) doesn't work. It might be a matter of wi-fi firmware. Fortunately, the stock prima_wlan.ko (proprietary 3.1.7.0) module works well.
Click to expand...
Click to collapse
you have to do some haxxing to get the CAF prima to load up
Zarboz said:
you have to do some haxxing to get the CAF prima to load up
Click to expand...
Click to collapse
I am interested of that hack. Could you, please, send me a link to some documentation about it?
AlxMAX said:
I am interested of that hack. Could you, please, send me a link to some documentation about it?
Click to expand...
Click to collapse
There isn't any I have found just trial and error
Sent from my HTC One X using xda app-developers app
Zarboz said:
There isn't any I have found just trial and error
Click to expand...
Click to collapse
If you are referring to the code enclosed by #ifdef CONFIG_HTC_WIFI_NVS ... #endif in wlan_hdd_main.c, then it is not simple trial and error. Have you picked the code from somewhere else and integrated into the prima sources or have you found the prima sources containing already that piece of code?
Hello everyone,
I read all the topics related but, unfortunately, it did not solve my problem.
I have a cubieboard (allwinner A10) and a screen that doesn't have HDMI input, instead it has DVI input. Therefore, I use a hdmi>dvi connector and i lose all the EDID, and Android doesn't show up (note: if i a specify some resolution in script0.bin, Android shows up in small resolution).
I have to specify the resolution in the firmware, but unfortunately the kernel distributed by Cubieboard is 3.0.52 and doesn't contain mine (1280x1024). Therefore, I have to build my own Android firmware with a recent kernel... and i fail every time, for months. (note: with gnu/linux i don't have any issue, i juste have to specify the resolution in kernel arguments on a txt file.. because the kernel is ulterior).
Please look at my method hereunder and tell me if you see some problems. Thanks in advance.
***
After lots of searches, i think that unpacking and repacking an existing livesuit image is the "easiest" way to upgrade the android kernel.
PHASE 1 : unpacking a stock livesuit android image
I use the "imgRePacker" utility (forum.xda-evelopers.com/showthread.php?t=1753473) and I unpack the "tvbox_2.2_8188eu.img" image from cubieoard.org. Now i have to change the files boot.fex and boot.fex.iso before repacking this livesuit image. Boot.fex and boot.fex.iso are the same file and are the "boot.img" containing bootheader, kernel and ramdisk (innovantesindia.com/wordpress/2011/04/18/bootimage-and-recovery-image-unveiled/).
I copy one of these two files and use the "split_bootimg.pl" to unpack it. I get kernel and ramdisk ; so i juste have to replace the old kernel by the new and execute "mkbootimg".
PHASE 2 : building a recent kernel
As the commit who interests me is your, i download a kernel containing it : the "sunxi-v3.0.76-r0" (github.com/jwrdegoede/linux-sunxi/releases/tag/sunxi-v3.0.76-r0). I unzip it and modify the sun4i_defconfig file to put maximum in the kernel and not in modules (because i'll send the modules later via adb, so maximum of things have to be in kernel). I modify the kernel cmdline by "console=ttyS0,115200 rw init=/init loglevel=5".
Then i execute
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- sun4i_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j5 uImage modules
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=output modules_install
FINAL PHASE : repacking with new kernel
The gzipped kernel is zImage in arch/arm/boot. I copy this file in the phase 1 directory and i execute
tools/mkbootimg --base 0x40000000 --kernel zImage --ramdisk boot.img-kernelramdisk.gz --cmdline 'console=ttyS0,115200 rw init=/init loglevel=5' -o new-recovery.img
Now i copy thenew-recovery.img file and put it in the imgRePacker folder instead of boot.fex and boot.fex.iso. I repack the image and flash it in the cubieboard and ... The cubieboard has its red the green led on but doesn't boot more .. I can't communicate with it via adb because it's not even recognized by windows (because it isn't booted).....
***
Please ! Can you help me ? Do you see any problem in my method ?
Thanks in advance.
up