Hello.
I'm trying adding several drivers into my SM-N9005 firmware. My phone runs Omega ROM v21, whose kernel doesn't support kernel module drivers, so I decided to recompile Omega's kernel from sources with needed options. The sources were taken from here:
https://github.com/omega-roms/N9005_Omega_Kernel_KK_4.4.2
The compilation was easy, the drivers were compiled too, I have my zImage now.
I downloaded Omega's flashable kernel-only zip N9005_Omega_Kernel_KK_v1.1_XXUFNF4_ramdisk.zip from Omega's repo, unpacked boot.img from the zip and tried disassembling it with split_boot script from bootimg_tools found here:
http://forum.xda-developers.com/showthread.php?t=2319018
I got the following output:
Page size: 2048 (0x00000800)
Kernel size: 8259720 (0x007e0888)
Ramdisk size: 1581598 (0x0018221e)
Second size: 0 (0x00000000)
Board name:
Command line: 'console=null androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3'
Base address: (0x01dfff00)
Writing boot/boot.img-kernel ... complete.
Writing boot/boot.img-ramdisk.cpio.gz ... complete.
Unpacking ramdisk... complete.
So I got original Omega's kernel boot.img-kernel and ramdisk boot.img-ramdisk.cpio.gz. Next I decided to reassemble it and flush back, coz' if it works - my kernel might work too.
I took mkbootimg tool from the same package and created new boot.img with it, using parameters I got previously from split_boot script:
./mkbootimg --kernel boot/boot.img-kernel --ramdisk boot/boot.img-ramdisk.cpio.gz --cmdline 'console=null androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3' --base 0x01dfff00 --pagesize 2048 -o boot.img
So I got new boot.img with size 9846784 bytes, whereas original Omega's boot is 11149312 bytes.
I packed my boot.img into original Omega's kernel zip N9005_Omega_Kernel_KK_v1.1_XXUFNF4_ramdisk.zip, replacing existing original boot.img inside, renamed the zip and flushed with recovery.
Now my phone falls into download mode, saying 'Could not do normal boot'. Flashing back original Omega's kernel restores the phone to normal state, so the problem is with reassembling boot.img
What am I missing? Please, help.
The answer was easy: Android Image Kitchen v1.6 for Linux from http://forum.xda-developers.com/showthread.php?t=2073775
My kernel is rebuilt and my device is now working ok! Thanks to the authors.
jeweller_by said:
The answer was easy: Android Image Kitchen v1.6 for Linux from http://forum.xda-developers.com/showthread.php?t=2073775
My kernel is rebuilt and my device is now working ok! Thanks to the authors.
Click to expand...
Click to collapse
Thanks!
Related
Good evening all!!
Well after two days of hitting my head against the wall I decided to ask for help.. typical guy here!!
Problem: when using the blobtools to create a boot blob it soft bricks my transformer. No idea why.
Objective: Create a bootable boot blob with init.rc changes
Steps token to create the boot blob:
::Tools Used::
- BlobTools created by RaYmAn
- BootTools created by RaYmAn
::Blob used:: Stock kernel provided by clemsyn ( h t t p : / / w w w . megaupload.com/?d=GSIHUPJ6 ) kernelblob
1. After compiling blobtools I used "blobunpack" to unpack my blob
Code:
./blobunpack /home/mike/Android/kernelblob
Once done it produced "kernelblob.HEADER" and "kernelblob.LNX"
2. After compiling boottools I used "bootunpack" to unpack "kernelblob.LNX"
Code:
./bootunpack /home/mike/Android/kernelblob.LNX
Which produced "kernelblob.LNX-kernel.gz" and "kernelblob.LNX-ramdisk.cpio.gz"
3. Then I uncompressed "kernelblob.LNX-ramdisk.cpio.gz"
Code:
gunzip -c /home/mike/Android/kernelblob.LNX-ramdisk.cpio.gz | cpio -i
Which produced the initramfs. Made my changes to init.rc
4. Re-created ramdisk using this command
Code:
find . | cpio -o -H newc | gzip > ../newkernelblob.LNX-ramdisk.cpio.gz
5. Then re-create kernelblob.LNX (boot.img) with mkbootimg
Code:
mkbootimg --cmdline 'no_console_suspend=1 console=null' --kernel kernelblob.LNX-kernel.gz --ramdisk newkernelblob.LNX-ramdisk.cpio.gz -o newkernelblob.LNX
6. re-created blob using blobpack
Code:
./blobpack kernelblob.HEADER boot_blob LNX newkernelblob.LNX
Example provided by RaYmAn
Code:
./blobpack blobname.HEADER outputfile LNX boot.img
Then I try to flash the new boot_blob but after I reboot it just gets stuck on the ASUS screen...
Thanks for taking the time to read this and help me!!!! Hope this will help others
Just to note:: Even if I do not make changes to init.rc it still does not boot which tells me it might have something to do with the way I'm repacking the blob..... Thanks again for anyones help!!!
Anyone?????
trying to keep the thread alive.... I've tried with the offical blob too. No luck!
I am running ubuntu 64-bit with jdk installed!
The problem is the fact that you pass a cmdline to the mkbootimg command.
On most tegra2 based devices, the cmdline is passed by the bootloader UNLESS the boot.img has a cmdline. Your cmdline is obviously wrong for a tegra2 device, so it never boots.
I have been trying for two days now and after searching and searching, I am asking for some help.
I had an idea of changing the SELinux status from enforcing to permissive. This needs to be done in the kernel.
So I downloaded Samsung SM-N9005 source files and built the kernel. I have the zImage.
I just need some help with getting, and unpacking a boot.img file, replacing the kernel with my zImage and repacking the kernel and ramdisk into a boot.img to flash.
I have tried mkbootimg and unmkbootimg among other tools.
I get the following warning:
Code:
*** WARNING ****
This image is built using NON-standard mkbootimg!
OFF_KERNEL_ADDR is 0xFE208100
OFF_RAMDISK_ADDR is 0x00200100
OFF_SECOND_ADDR is 0xFF100100
Please modify mkbootimg.c using the above values to build your image.
****************
I did a clockworkmod backup and used the boot.img from there. Is that correct procedure?
Please please please please someone with kernel knowledge give me a helping hand, it will make my day!
Send over your zImage and the stock boot.img, I can give it a try and explain how if it works.
designgears said:
Send over your zImage and the stock boot.img, I can give it a try and explain how if it works.
Click to expand...
Click to collapse
Ok here they are:
zImage: http://www.multiupload.nl/J9TP9YCV8H
stock boot.img: http://www.multiupload.nl/6FVBWOOYHX
Many Thanks
designgears said:
Send over your zImage and the stock boot.img, I can give it a try and explain how if it works.
Click to expand...
Click to collapse
[email protected]:~/Android-Kitchen-0.224/WORKING_mj7_9008$ unpack boot.img
Boot = boot.img
unmkbootimg version 1.2 - Mikael Q Kuisma <[email protected]>
Kernel size 8488008
Kernel address 0x8000
Ramdisk size 1335394
Ramdisk address 0x2000000
Secondary size 0
Secondary address 0xf00000
Kernel tags address 0x1e00000
Flash page size 2048
Board name is ""
Command line "console=null androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3F"
*** WARNING ****
This image is built using NON-standard mkbootimg!
OFF_KERNEL_ADDR is 0xFE208100
OFF_RAMDISK_ADDR is 0x00200100
OFF_SECOND_ADDR is 0xFF100100
Please modify mkbootimg.c using the above values to build your image.
****************
Extracting kernel to file zImage ...
Extracting root filesystem to file initramfs.cpio.gz ...
All done.
---------------
To recompile this image, use:
mkbootimg --kernel zImage --ramdisk initramfs.cpio.gz --base 0x1dfff00 --cmdline 'console=null androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3F' -o new_boot.img
---------------
5170 块
the zImage:https://mega.co.nz/#!uNY1gBzZ!L2qLYjEMQ-x9HRGl4GKs3XR8fTgCH0BBRvTuyfiKS5M
the boot.img:https://mega.co.nz/#!jIwhhboD!c2V21gS3DZIXsIKUUpaM6wIL_SZNzLmSRMqQw2Rn7G8
thanks
What happened ? what is the solution to this ?
Five years later ???
Hi,
if i try to build my own kernel for d802, i have a little problem. it should be for cm-11.0 and i tried the stock cm-11.0 kernel to test it.
i use:
./dtbTool -s 2048 -o dt.img -p cm11/scripts/dtc/ cm11/arch/arm/boot/
to get my dt.img
and:
./mkbootimg --kernel cm11/arch/arm/boot/zImage --ramdisk ramdisk.gz --cmdline "console=ttyHSL0,115200,n8 androidboot.hardware=g2 user_debug=31 msm_rtb.filter=0x0" --base 0x00000000 --offset 0x05000000 --tags-addr 0x04800000 --pagesize 2048 --dt dt.img -o boot.img
to build the boot.img (ramdisk extracted from cm11).
i put it into a loki-fied .zip to install it and the installation works, but if i try to boot it stuck on lg logo. can anyone help me? is there a problem with my lines above?
AuxXxilium said:
Hi,
if i try to build my own kernel for d802, i have a little problem. it should be for cm-11.0 and i tried the stock cm-11.0 kernel to test it.
i use:
./dtbTool -s 2048 -o dt.img -p cm11/scripts/dtc/ cm11/arch/arm/boot/
to get my dt.img
and:
./mkbootimg --kernel cm11/arch/arm/boot/zImage --ramdisk ramdisk.gz --cmdline "console=ttyHSL0,115200,n8 androidboot.hardware=g2 user_debug=31 msm_rtb.filter=0x0" --base 0x00000000 --offset 0x05000000 --tags-addr 0x04800000 --pagesize 2048 --dt dt.img -o boot.img
to build the boot.img (ramdisk extracted from cm11).
i put it into a loki-fied .zip to install it and the installation works, but if i try to boot it stuck on lg logo. can anyone help me? is there a problem with my lines above?
Click to expand...
Click to collapse
hey .. that looks correct to me. what rom are you trying to boot your boot.img with? i know if u using the latest CM11 branch it adds alot of commits that require new blobs .. unless that rom has those new blobs it won't boot.
houstonn said:
hey .. that looks correct to me. what rom are you trying to boot your boot.img with? i know if u using the latest CM11 branch it adds alot of commits that require new blobs .. unless that rom has those new blobs it won't boot.
Click to expand...
Click to collapse
i tried on a your rom but it didn't boot. i'll try it on cm11 to confirm it. thx for your help.
Hi
I am used to rebuild boot images with unkmbootimg/mkbootimg on my S4 mini. When I repack a G900F a working stock boot.img and flash it with Odin, the device boots into download mode. I didn't made any changes in the ramfs, the sources are binary the same, but when I repack it to the boot.img it's different to the stock.
Is my bootloader locked? Do I need a special mkbootimg to enable SEAndroid enforcing? It does not matter if I disable it in the ramfs. Do I have to modify the kernel too?
Regards
It seems, that not the boot image is the problem but the cpio initramfs.
I can use the command
Code:
abootimg -u boot.img -r initrd.img
to replace the ramdisk in a working boot image. This works only if a replace the current initramfs with the original initramfs. If I unpack the initramfs too and repack the exact same sources, it won't boot. The sources are binary the same, but the packed initramfs is totally different.
I use the following command to repack my initramfs:
Code:
find . | cpio -o -H newc | gzip > ../initrd.img
cloooned said:
It seems, that not the boot image is the problem but the cpio initramfs.
I can use the command
Code:
abootimg -u boot.img -r initrd.img
to replace the ramdisk in a working boot image. This works only if a replace the current initramfs with the original initramfs. If I unpack the initramfs too and repack the exact same sources, it won't boot. The sources are binary the same, but the packed initramfs is totally different.
I use the following command to repack my initramfs:
Code:
find . | cpio -o -H newc | gzip > ../initrd.img
Click to expand...
Click to collapse
I don't know if this is still relevant to you, but I have found that so far the only tool that repacks s5 kernel properly is the Osm0sis kernel kitchen. I am working on linux and I was able to pack my compiled zimage and modified ramdisk using his tool. You can read more on his original thread here .
I hope thos help you.
I have unpacked some boot.img files and wanted to repack them after editing the ramdisk. Does anyone know the proper command to repack for the LG G2?
I am currently using:
./bins/mkbootimg --kernel $kernel --ramdisk $ramdisk \
--cmdline "console=ttyHSL0,115200,n8 androidboot.hardware=g2 user_debug=31 msm_rtb.filter=0x0 mdss_mdp.panel=1:dsi:0:qcom,mdss_dsi_g2_lgd_cmd" \
--base 0x00000000 --pagesize 2048 --tags-addr 0x4800000 --offset 0x5000000 \
--dt ./bins/dt_g2.img --output new_boot.img
(From a script I modified)
It builds the correct addresses but the phone goes into a bootloop. Before I got the addresses right, I got fastboot. If tried the above command (which I modified). I've also tried using the command the unpack tool said to use. In addition, if tried the command in the script used to build the bootimg when omnirom is compiling. I've tried varying combos.
Yes, I am using the custom mkbootimg. I fished it out of the kernel objects directory after a successful recovery compile.
Thanks!