Monday, May 30, 2016

Need advice about “mkbootimg” (compiling android kernel)

I´m working on compiling an kernel from SonyXperiaDev source, have already build kernel zImage with:
HTML Code:

make ARCH=<arch> CROSS_COMPILE=$CROSS_COMPILE <device_defconfig>
make ARCH=<arch> CROSS_COMPILE=$CROSS_COMPILE -j <cpu_thread_number>
make ARCH=arm CROSS_COMPILE=$CROSS_COMPILE -j12  -C  M=$PWD CONFIG_PRIMA_WLAN=m CONFIG_PRIMA_WLAN_LFR=y KERNEL_BUILD=1 WLAN_ROOT=$PWD

I extract the ramdisk.cpio.gz from my device now i´m able to assemble the new boot image. But i'm not sure about the mkbootimg file that is neccessary for assemble the boot.img here a request of the compiling guide:

Quote:

Assemble the boot image file The kernel image and the RAM image need to be assembled in a boot image file. The boot image file will then be flashed to your phone or tablet. Depending on your device, you need to use the tool mkqcdtbootimg, provided by SonyXperiaDev on GitHub, or mkbootimg, provided by the Android Open Source Project, to create the boot image. Please note that the program must be compiled differently depending on which system you are running.
In my case i need the mkbootimg from AOSP but how can i find the right one?

here the command for the next step:

HTML Code:

./mkbootimg --base 0x80200000 --kernel zImage --ramdisk_offset 0x02000000 --cmdline "androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 vmalloc=400M androidboot.emmc=true" --ramdisk ramdisk.cpio.gz -o boot.img
Details to my Device:
Quote:

[ro.product.cpu.abilist32]: [armeabi-v7a,armeabi]
[Xperia Z]
[ro.com.google.gmsversion]: [5.1_r2]
[Sony/C6603/C6603:5.1.1/10.7.A.0.222]

I was looking here for the source mkbootimg:
http://ift.tt/25wV7Tb
http://ift.tt/25wVbmb

it contains the mkbootimmg.c but the kernel and ramdisk offset are diffrent to the sony instrucktion.
HTML Code:

boot_img_hdr hdr;

    char *kernel_fn = 0;
    void *kernel_data = 0;
    char *ramdisk_fn = 0;
    void *ramdisk_data = 0;
    char *second_fn = 0;
    void *second_data = 0;
    char *cmdline = "";
    char *bootimg = 0;
    char *board = "";
    unsigned pagesize = 2048;
    int fd;
    SHA_CTX ctx;
    const uint8_t* sha;
    unsigned base          = 0x10000000;
    unsigned kernel_offset  = 0x00008000;
    unsigned ramdisk_offset = 0x01000000;
    unsigned second_offset  = 0x00f00000;
    unsigned tags_offset    = 0x00000100;
    size_t cmdlen;


How can i identify the right mkbootimg file for assembly zImage and ramdisk.gz?


Thank you


from xda-developers http://ift.tt/1Z92CZs
via IFTTT

No comments:

Post a Comment