android kernel nasıl düzenlernir?

Sponsorlu Bağlantılar

Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...
oguzhan mobile

oguzhan mobile

Üye
    Konu Sahibi
android kernel nasıl düzenlernir?
[h=2]Unpacking, Editing, and Re-Packing the images[/h]Note: below I give you the details for unpacking and repacking manually, but I created two perl scripts that do most of this for you ( , ).


If you are good with a hex editor, you can open up any of these images and strip off the first 2k of data. Then, look for a bunch of zeroes followed by the hex 1F 8B (which is the magic number of a gzip file). Copy everything from the first line of the file, through the zeroes, and stopping at the 1F 8B. That is the kernel. Everything from the 1F 8B through the end is the ramdisk. You could save each of these files separately. In order to see the contents of the ramdisk, you need to un-gzip it and then un-cpio it. You could use a command like this (ideally after creating a new directory and cd'ing into it):

gunzip -c ../your-ramdisk-file | cpio -iThat will place all of the files from the ramdisk in your working directory. You can now edit them.
In order to re-create the ramdisk, you need to re-cpio them and re-gzip those files, with a command like the following (remember, cpio will include everything in the current working directory, so you probably want to remove any other cruft you might have in there):



find . | cpio -o -H newc | gzip > ../newramdisk.cpio.gzThe final step is to combine the kernel and your new ramdisk into the image, using the program (which you should download and compile from the git repository):



mkbootimg --cmdline 'no_console_suspend=1 console=' --kernel your-kernel-file --ramdisk newramdisk.cpio.gz -o mynewimage.img
Now, there's a lot of hassle in pulling apart files in hex editors and remembering all of these commands, so I wrote unpack and repack perl scripts for you. Hooray.

[h=3]Alternative Method[/h]Download . This Zip file contains one Perl file, split_bootimg.pl, which reads the boot.img header (according to the ) to extract the kernel and ramdisk. The script also outputs the kernel command line and board name (if specified).
(Note: Do not use a boot.img image extracted directly from /dev/mtd/mtd2. This image may become corrupted during the read process.)
The following example uses the boot.img from the TC4-RC28 update:



% ./split_bootimg.pl boot.img Page size: 2048 (0x00000800)Kernel size: 1388548 (0x00153004)Ramdisk size: 141518 (0x000228ce)Second size: 0 (0x00000000)Board name: Command line: no_console_suspend=1Writing boot.img-kernel ... complete.Writing boot.img-ramdisk.gz ... complete.
Extract the ramdisk.



% mkdir ramdisk% cd ramdisk% gzip -dc ../boot.img-ramdisk.gz | cpio -i% cd ..
Make any changes necessary (e.g., set ro.secure=0 in default.prop).

Recreate the cpio archive using the mkbootfs binary produced from building the Android source code (The cpio utility in OS X does not recognize the newc format, thereforemkbootfs is the best option for OS X users).



% mkbootfs ./ramdisk | gzip > ramdisk-new.gz
Recreate the image file using the mkbootimg binary produced from building the Android source code.




% mkbootimg --cmdline 'no_console_suspend=1 console=' --kernel boot.img-kernel --ramdisk ramdisk-new.gz -o boot-new.img
For Nexus One
: Add --base 0x20000000 to mkbootimg command-line.


(Note: the console= command line option was introduced in the TC4-RC30 boot images to remove the root shell (TODO: add link))


----------Eklendi @ 14:53:08 ---------- Yazıldı @ 14:50:21 ----------

yabacı sitede buldum anlayamdım yardımcı olursanız sevinirim
 
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...


Üst Alt