Hello. I am following this tutorial Doomlord tutorial for our devices and also this tutorial for compiling from abcdjdj and i am on step - building kernel.elf . I have extracted the kernel.sin with flashtool and i have zImage, ramdisk.img and RPM.bin. Later i downloaded this script for mkelf.py to get this file - mkelf.py . Next step is to use this command for JB -
Code:
python mkelf.py -o kernel.elf [email protected] [email protected],ramdisk [email protected],rpm [email protected],cmdline
Is this code the same for the xperia V(4.3 - .210 build) or its a different one?
I need some help i will be happy if someone helps.
krasimiretov said:
Hello. I am following this tutorial Doomlord tutorial for our devices and also this tutorial for compiling from abcdjdj and i am on step - building kernel.elf . I have extracted the kernel.sin with flashtool and i have zImage, ramdisk.img and RPM.bin. Later i downloaded this script for mkelf.py to get this file - mkelf.py . Next step is to use this command for JB -
Code:
python mkelf.py -o kernel.elf [email protected] [email protected],ramdisk [email protected],rpm [email protected],cmdline
Is this code the same for the xperia V(4.3 - .210 build) or its a different one?
I need some help i will be happy if someone helps.
Click to expand...
Click to collapse
Well, that code is for JB, you're compiling for JB, so I don't see why you'd think it wouldn't work; did it not work?
I've used this to create the kernel.elf for my TX from the zImage, RPM.bin and ramdisk.img; beats having to use input commands manually.
Hello. I compiled it and it booted so its fine. Now i want to add recovery to the kernel but problem is i dont know exactly how. There is no stock kernel with recovery integrated in ramdisk so i cant take it. I think ramdisk from Omni kernel wont work becouse its AOSP or it will work becouse it uses new kernel source i dont know. If anyone one can help add recovery(TWRP or CWM or else) please write
krasimiretov said:
Hello. I compiled it and it booted so its fine. Now i want to add recovery to the kernel but problem is i dont know exactly how. There is no stock kernel with recovery integrated in ramdisk so i cant take it. I think ramdisk from Omni kernel wont work becouse its AOSP or it will work becouse it uses new kernel source i dont know. If anyone one can help add recovery(TWRP or CWM or else) please write
Click to expand...
Click to collapse
http://forum.xda-developers.com/showpost.php?p=52398254&postcount=4
I'm sure there might be stock kernels with a CWM; but if not, you might want to try what I did in that post. Just pull the RPM.bin and cmdline.txt from any other .elf stock kernel that there might be for the V, and use the rest from your kernel.
Related
Hi,
Could anybody tell me which are the bare minimum sources needed to compile a working cyoanogenmod 9 kernel boot.img?
I'm currently trying to compile one on my own but I can't afford to download the whole CM9 source due to the internet contract i have.
Thanks
Nobody? Ok then... May someone please copy and paste their makefile inside the root directory of his Android tree? (the one from wich they issue the command "make -j4 out/target/product/galaxysmtd/boot.img").
Maybe you could try cloning the android_build project and the teamhacksung buildscript project as well. Then adjust the buildscripts to point to the correct toolchain directory...
Boot.img contains the kernel. Therefore you need the kernel sources since at cm9 the kernel is build while compiling cm. You can find that sources at github (in project kernel_samsung_aries or something). You need to put this directory to your root directory of your android build system (there you have the device dir, frameworks, vendor etc). Rename it into kernel/samsung/aries. Then you should be able to build. It has worked like this for i9001, and it should also for i9000
You could also look at the kernel source of semaphore/devil. They use their own build script which does not require the full cm9 source, but only the kernel source. I made an adapted version of their scripts to build my own kernel...
Verstuurd van mijn GT-I9000
I think he already has:
__Pol__ said:
Nobody? "make -j4 out/target/product/galaxysmtd/boot.img"
Click to expand...
Click to collapse
Thanks everybody!
Sorry if the first two posts misled you.
I already have the kernel source. What I need are some instructions in order to build the boot.img from them. I can't download the whole source branch because I'm on a data diet .
Also a copy paste of the main make file is accepted.
I think this could help you:
http://forum.xda-developers.com/showthread.php?p=28096022
It's again for i9001 (sorry, but I own one ), but should also work
I think this could help you:
http://forum.xda-developers.com/show...php?p=28096022
It's again for i9001 (sorry, but I own one ), but should also work
Click to expand...
Click to collapse
Thanks. I've already tried the split_bootimg.pl but it did not work. According to sbuild.sh from semaphore kernel what i need to do is just "cp bzImage boot.img". I had already done it before but my phone did not boot up. It showed the bootloader logo but then nothing so something is wrong with the initramfs. Is the one included with the kernel sources correct or am I missing something?
So you can build the kernel? And just copying the kernel image to boot.img won't work. As you can see in the splitted boot.img from arco or anyone else, there are some other things needed.
I think you need to split it, replace the kernel image (zImage I thinl) and put all files again together (including the other files from the working boot.img).
No warranty on that, but that's what I understood
hahnjo said:
So you can build the kernel? And just copying the kernel image to boot.img won't work. As you can see in the splitted boot.img from arco or anyone else, there are some other things needed.
I think you need to split it, replace the kernel image (zImage I thinl) and put all files again together (including the other files from the working boot.img).
No warranty on that, but that's what I understood
Click to expand...
Click to collapse
Actually I can't split the boot.img because split_bootimg.pl does not work. The problem is in the initramfs and that is why I was asking for some advice about the sources needed. The auto-generated initramfs does not work.
__Pol__ said:
Actually I can't split the boot.img because split_bootimg.pl does not work. The problem is in the initramfs and that is why I was asking for some advice about the sources needed. The auto-generated initramfs does not work.
Click to expand...
Click to collapse
When I tried it, it worked... Are you sure that you have Pearl installed. Which OS do you use?
How do you generate initramfs?
I'm running Debian wheezy, pearl is installed. The script says it has not found android magic. The initramfs is automatically generated by the kernel source. I fear some files are missing here: https://github.com/CyanogenMod/android_kernel_samsung_aries
Do I need to get *bootimg from here?
https://github.com/CyanogenMod/android_device_samsung_aries-common
If yes how do I use these 2 scripts?
Sorry they're not two scripts but a script and a make file. From where does that makefile obtain the variables?
For splitting, did you use a running boot.img, e.g. from CM9 for your device?
You have two possibilities for building a running boot.img:
1) It is builded if you compile CM or AOSP or another ROM from Source (therefore you would need the complete sources)
2) You only build the Kernel and put it in an existing boot.img (for your phone of course) by just replacing the kernel.
For second you need to split an existing boot.img
Hi
Sent from my GT-S5830 using xda app-developers app
hahnjo said:
For splitting, did you use a running boot.img, e.g. from CM9 for your device?
You have two possibilities for building a running boot.img:
1) It is builded if you compile CM or AOSP or another ROM from Source (therefore you would need the complete sources)
2) You only build the Kernel and put it in an existing boot.img (for your phone of course) by just replacing the kernel.
For second you need to split an existing boot.img
Click to expand...
Click to collapse
Well, actually there's a third method. I need the initramfs source, the kernel source and the recovery source. After building I need to pack them together. Until yesterday I had only the sources for kernel and initramfs (?). Now I'll head for some sources for the recovery but I still need the main makefile (inside the Android directory) to know what commands I have to issue.
Sorry guys if I stil can't explain my problem to you. I really appreciate your patience and your helpful tips though.
You could look at devil/semaphore, as they use a complete initramfs, including recovery (both have a slightly different implementation).
Verstuurd van mijn GT-I9000
kasper_h said:
You could look at devil/semaphore, as they use a complete initramfs, including recovery (both have a slightly different implementation).
Verstuurd van mijn GT-I9000
Click to expand...
Click to collapse
Yep! I had a look there and I understood I was missing the recovery. Semaphore uses a custom amde initramfs and recovery whith load of scripts I don't need. I downloaded the CWM source from cyanogenmod git. There is only an Android.mk that obviously won't work. The question still remains: has anybody here downloaded the whole cyanogenmod source? If yes, may they post the makefile here please?
I have the whole CM sources, CM7 and CM9. Atm I can't access them because I'm on travel. I will return next week, maybe then.
Though, I think that it is impossible to extract the needed Makefiles. The Main-Makefile includes another makefile, but from then on several files are included which include again files. I stopped trying to understand it after the first 3 files...
let me explain my problem, i've created a .ftf (kernel for xperia x8) and it is boot up but i missed some files inside the ramdisk, so now i need to repack my new ramdisk folder into ramdisk file and i don't know how to do that .
Read my guide on how to compile and put together a custom kernel for the X8: http://forum.xda-developers.com/showthread.php?t=1923240
The method (whatever it is) you are following is not correct for any Android phone.
Oops. I guess it isn't mentioned there.
Basically what you have to do is open up a Terminal in Ubuntu. Navigate to your ramdisk folder (the one that contains the init.rc, init.usb.rc etc.). Then issue this command:
Code:
find . | cpio -o -H newc | gzip > ../ramdisk
Grab the ramdisk from one directory above your ramdisk folder.
Sorry for the confusion.
sgt. meow said:
Read my guide on how to compile and put together a custom kernel for the X8: http://forum.xda-developers.com/showthread.php?t=1923240
The method (whatever it is) you are following is not correct for any Android phone.
Click to expand...
Click to collapse
i don't understund one thing, when i'm getting the ramdisk file? when compiling the rom?or the kernel?
i've compiled cm10.1 rom and i need to change the bootclasspath
You have to unpack a working kernel with DooMLorD's kernel.sin unpacker. You'll get the ramdisk. Then edit the BOOTCALSSPATH in init.rc.
sgt. meow said:
Read my guide on how to compile and put together a custom kernel for the X8: http://forum.xda-developers.com/showthread.php?t=1923240
The method (whatever it is) you are following is not correct for any Android phone.
Oops. I guess it isn't mentioned there.
Basically what you have to do is open up a Terminal in Ubuntu. Navigate to your ramdisk folder (the one that contains the init.rc, init.usb.rc etc.). Then issue this command:
Code:
find . | cpio -o -H newc | gzip > ../ramdisk
Grab the ramdisk from one directory above your ramdisk folder.
Sorry for the confusion.
Click to expand...
Click to collapse
when i run the i get this error
bash: ../ramdisk: Is a directory
Name the folder that has the ramdisk contents something like "XYZ" and put it in another folder named "ABC". Then issue this command.
So basically the structure would be:
/ABC/XYZ/* /*ramdisk contents have been denoted by * */
And after issuing the command grab the ramdisk from ABC folder.
sgt. meow said:
Name the folder that has the ramdisk contents something like "XYZ" and put it in another folder named "ABC". Then issue this command.
So basically the structure would be:
/ABC/XYZ/* /*ramdisk contents have been denoted by * */
And after issuing the command grab the ramdisk from ABC folder.
Click to expand...
Click to collapse
yeah thank you now it's working but i think something is missing , can you help me in developed kernel for cm10.1 ?
i already compiled the rom but now i'm struggling with the kernel part , i can send you all the files for the ramdisk and if you can put together a working kernel it will be great and i can move on and fix the problems with the rom itself
Look man. I can download the source and help you compile the kernel and the ramdisk. But as Daveee10 has said, even if you get it booting, there are tons of things that need to be backported (which is extremely hard) for it to work properly. So it's almost like choosing a route that you know will lead to a dead-end. But I'll help anyway.
PM me.
Hello There.
First of all, is it possible to install both PAC-man 4.3 ROM and SlimBeam 4.3 using MultROM?
If Yes, how to do this correctly/what am I doing wrong?
I have TWRP 2.6.0.0 and MultROM installed. Tried different combinations and nothing work.
I'm not much into this stuff, so as far as I could go I have investigate the issue of kernels and kexec, but as I said, my knowledge stopped on knowing that there is such thing, and secondary ROM can be installed with different, separated kernel.
Thanks for interest.
I thought that it would be helpful if I write what combination/order of instalation gives what result, so here it goes:
1. Installing SlimBeam, and then PAC: E: Error executing update binary in zip 'tmp/mr_update.zip'
2. Installing PAC, and then SlimBeam: Installation complited correctly, secondary system(SlimB) loading forever with PAC boot animation - probbably because of kernel?
3. Installing PAC and then SlimBeam with seperated cernel: (In Multiroom when booting SlimB) Error Kexec-hardboot support required to boot this ROM...
In this case I'm guessing that patching this kernel could help, but it's superadvanced for me
noone1101 said:
Hello There.
First of all, is it possible to install both PAC-man 4.3 ROM and SlimBeam 4.3 using MultROM?
If Yes, how to do this correctly/what am I doing wrong?
I have TWRP 2.6.0.0 and MultROM installed. Tried different combinations and nothing work.
I'm not much into this stuff, so as far as I could go I have investigate the issue of kernels and kexec, but as I said, my knowledge stopped on knowing that there is such thing, and secondary ROM can be installed with different, separated kernel.
Thanks for interest.
I thought that it would be helpful if I write what combination/order of instalation gives what result, so here it goes:
1. Installing SlimBeam, and then PAC: E: Error executing update binary in zip 'tmp/mr_update.zip'
2. Installing PAC, and then SlimBeam: Installation complited correctly, secondary system(SlimB) loading forever with PAC boot animation - probbably because of kernel?
3. Installing PAC and then SlimBeam with seperated cernel: (In Multiroom when booting SlimB) Error Kexec-hardboot support required to boot this ROM...
In this case I'm guessing that patching this kernel could help, but it's superadvanced for me
Click to expand...
Click to collapse
The kernel of your primary ROM needs to support kexec. I don't think this is true for the pac nor the slim kernel. You will have to flash a custom kernel on your primary ROM.
Dexxon said:
The kernel of your primary ROM needs to support kexec. I don't think this is true for the pac nor the slim kernel. You will have to flash a custom kernel on your primary ROM.
Click to expand...
Click to collapse
Exactly.
Idk either how it looks like with pac as secondary, because of such mentioned problems.
I am on a good way to finding right kernel for that and trying to flash it, and test if it works.
Ty for reply.
noone1101 said:
Exactly.
Idk either how it looks like with pac as secondary, because of such mentioned problems.
I am on a good way to finding right kernel for that and trying to flash it, and test if it works.
Ty for reply.
Click to expand...
Click to collapse
Your Problems consists of 3 things:
1. U need a kernel with Kexec-Support for the primary Rom to be able to boot secondary rom with other kernel. If u use same kernel for both rom, u dont need a kernel with Kexec-Support
2. To flash the kernel for secondary rom, u need a repacked kernel with ramdisk from destination rom, anykernel wont work, cause u cant flash it on secondary. It writes with "dd" direct to partition and this is wrong way for secondary Rom. So u have to choose a repacked kernel for secondary...
3. The script in most install.zips for 4.3 roms contains symlinks written over more than one line. These scripts wont work with multirom installer (TWRP MultiRom), so u have to modify script, extract from zip, write all symlinks and all other commands (which are broken into more than 1 line) in 1 line and copy back into zip. Install will work now (modification is for "Error executing update binary in zip 'tmp/mr_update.zip').
Bogeyof said:
Your Problems consists of 3 things:
1. U need a kernel with Kexec-Support for the primary Rom to be able to boot secondary rom with other kernel. If u use same kernel for both rom, u dont need a kernel with Kexec-Support
2. To flash the kernel for secondary rom, u need a repacked kernel with ramdisk from destination rom, anykernel wont work, cause u cant flash it on secondary. It writes with "dd" direct to partition and this is wrong way for secondary Rom. So u have to choose a repacked kernel for secondary...
3. The script in most install.zips for 4.3 roms contains symlinks written over more than one line. These scripts wont work with multirom installer (TWRP MultiRom), so u have to modify script, extract from zip, write all symlinks and all other commands (which are broken into more than 1 line) in 1 line and copy back into zip. Install will work now (modification is for "Error executing update binary in zip 'tmp/mr_update.zip').
Click to expand...
Click to collapse
the alternative to problem 3 is to install a rom, do a backup, install the rom you want and restore a backup as second rom. thats how i did it, noob-way
PREAMBLE
Just to clear things up - I'm definitely not responsible for anything. This patch will not work on devices with locked bootloaders.
Tasssadar said:
This patch was made by Mike Kasick for Samsung Epic 4G. Since that, it was ported to several devices, one of them is Asus Transformer TF201 - I used patch from TF201 and modified it a bit (basically just changed few SoC specific constants). People at #ubuntu-arm helped me out with that, thanks.
For flo, I've improved the patch a bit - only the host needs to be patched now and I also fixed a bug with /proc/atags not reading all tags.
Click to expand...
Click to collapse
Thanks to omnirom - I used their kernel as a base.
Special thanks to Tasssadar for his kexec-hardboot patch for the Nexus 4. Also thanks to alvinhochun and krabappel2548. I borrowed some of their code.
WHAT'S KEXEC?
Tasssadar said:
It is syscall of Linux kernel, which allows you to boot another Linux kernel without restarting the device - "Linux boots itself". The functionality is equivalent to fastboot -c *cmdline* boot zImage initrd.img, but without PC and fastboot. It is fairly known thing, so more info at wikipedia and man kexec.
Standard kexec call unfortunatelly does not work on Nexus 4. It freezes somewhere, and it is very difficult to find out where - probably some of the drivers are not shut down/re-initialized properly, it is a commong thing among Android devices, which is why kexec-hardboot was made.
Click to expand...
Click to collapse
What is the difference between normal and hardboot kexec?
Tasssadar said:
Kexec-hardboot patch adds a real device restart to that process, so that all the drivers can be properly reinitialized. It stores new kernel to RAM, reboots the device as usual, and kernel from boot partition immediately jumps to the one which was stored to RAM before reboot.
Unlike grouper's kexec-hardboot patch, this one only requires the host kernel to be patched. This is one of the improvements I made, and I think it is pretty significant.
To sumarize the process:
kexec --load-hardboot.... is called and kernel it loaded into RAM.
kexec -e is called. Special info is written to memory (to area which is not overwritten on reboot) and the device is rebooted.
After reboot, very early in the boot process, kernel checks if that special info is present in RAM and if so, it loads new kernel from RAM and jumps to it.
Kexecd' kernel starts and boots.
For more info, read the original thread.
Click to expand...
Click to collapse
INSTRUCTIONs
Download kexec-hardboot-yuga.zip and unzip it
Flash my patched host kernel (kexec-kernel-20140808-yuga.zip)
Push initrd.img, kexec, kexec.sh and zImage to /cache
Use a terminal to do the following:
Code:
adb shell
su
cd cache
chmod 0755 kexec
sh ./kexec.sh
SOURCEs
Kexec-hardboot patch
Kernel
XDA:DevDB Information
Kexec-hardboot patch for Sony Xperia Z, Tool/Utility for the Sony Xperia Z
Contributors
Olivier
Version Information
Status: Testing
Created 2014-08-08
Last Updated 2014-08-08
I'm sorry I would like to ask a question. If I kexec boot my phone with yuga kernel and cwm, flashes the yuga ROM would it be possible to get dual booting the Yuga ROM?
Source: http://forum.xda-developers.com/showpost.php?p=19460677&postcount=25
Pretty old source but would it be possible?
xarive said:
I'm sorry I would like to ask a question. If I kexec boot my phone with yuga kernel and cwm, flashes the yuga ROM would it be possible to get dual booting the Yuga ROM?
Source: http://forum.xda-developers.com/showpost.php?p=19460677&postcount=25
Pretty old source but would it be possible?
Click to expand...
Click to collapse
Sure thing
Gesendet von meinem Xperia Z mit Tapatalk
Nice to see you got a Z now.
Will try this one out definitly
Sweet! Trying this out straight after work!
Beans
I am still not quite clear about dual booting with kexec. Did OP done it before?
Sent from my C6603 using Tapatalk 2
Can we load some other kernal on our devices using kexec without unlocking bootloader??
I had a Motorola atrix 2 which used to do this..:fingers-crossed:
siddhesh1609 said:
Can we load some other kernal on our devices using kexec without unlocking bootloader??
I had a Motorola atrix 2 which used to do this..:fingers-crossed:
Click to expand...
Click to collapse
No, LB Yuga's are missing kexec, even compiling a external kernel module is not possible as the zimage is missing some required symbols for kexec to work.
Hi. I want to split two kernels. cyanogenmod and multirom (not for xperia z.)
i have kexec, and it working under multirom kernel.
i have edited one kernel, to load init file from another.
I am trayed zimage from multirom kernel.
Now i cannot run both. i can run cm12 kernel, and rut multirom from there, but cm12 wont boot.
when i used zimage from cm12 kernel, i can boot into cm12, but not in multirom.
is there any command to kexec to load another zimage only, and run another init file?
i have init (cm12) and from there i can use sh commands. i want load initmr (multirecovery) with another zimage file.
is it possible?
gouster3 said:
Hi. I want to split two kernels. cyanogenmod and multirom (not for xperia z.)
i have kexec, and it working under multirom kernel.
i have edited one kernel, to load init file from another.
I am trayed zimage from multirom kernel.
Now i cannot run both. i can run cm12 kernel, and rut multirom from there, but cm12 wont boot.
when i used zimage from cm12 kernel, i can boot into cm12, but not in multirom.
is there any command to kexec to load another zimage only, and run another init file?
i have init (cm12) and from there i can use sh commands. i want load initmr (multirecovery) with another zimage file.
is it possible?
Click to expand...
Click to collapse
Ok... What?
vishal_android freak said:
Ok... What?
Click to expand...
Click to collapse
Is there any arguments for kexec to reboot with another zimage, and exec? i want to run initmr (init file)?
but without ramdisk wipe. (or load ramdisk from kernel partition)?? init file with zimage are there.
when i use "exec /initmr", it will boot, but touch not working, and i have screen-shift bug.
Or. another way. how i can get "hot boot" into some boot.img using kexec on my build-in kernel?
Whatever I do, my custom build kernels fail to boot. There's the ZUK logo very briefly, then device drops to bootloader screen. I'm out of ideas what I'm doing wrong, maybe someone here can give me a hint. :good:
I've tried with current AEX kernel git snapshot and also stock kernel sources. Building using the AEX_defconfig goes ok, I have Image.gz, replace it in previously extracted "stock" boot image and use mkbootimg.py to rebuild the new image. Offsets etc. are all correct (I think), like this: (from AEX)
Code:
kernel=kernel
ramdisk=ramdisk
page_size=4096
kernel_size=9101281
ramdisk_size=2671109
base_addr=0x80000000
kernel_offset=0x00008000
ramdisk_offset=0x01000000
tags_offset=0x00000100
cmd_line='androidboot.hardware=qcom ehci-hcd.park=3 lpm_levels.sleep_disabled=1 [email protected] buildvariant=userdebug'
board=""
format=gzip
But the damn new image won't boot, like described above. There has to be something (probably very stupid) I'm missing...
If I replace my own Image.gz with the originally extracted one and mkboot and so on, it's ok. So I guess it has something to do with my kernel build and/or environment. Are there any subsequent steps needed to do with the compiled kernel Image.gz? Or is it just my kernel config which is wrong? But I'm using the AEX defconfig (n7x-caf_z2_row_defconfig, to be exactly) so this should be fine, no?
Ok, I've got it. I had forgottten (=didn't know about at all) to append the device tree blob (arch\arm64\boot\dts\qcom\msm8996-v3-pmi8996-mtp.dtb) to kernel zImage... Simply cat'ing these together works!
Goodluck bro.
void23 said:
Ok, I've got it. I had forgottten (=didn't know about at all) to append the device tree blob (arch\arm64\boot\dts\qcom\msm8996-v3-pmi8996-mtp.dtb) to kernel zImage... Simply cat'ing these together works!
Click to expand...
Click to collapse
please explain .. what exactly i need to do with that file..