Giter Site home page Giter Site logo

xperia-e1-kernel-patches's Introduction

customizing the Xperia E1 kernel

building the kernel

This is the easy part.

  • Download the source tarball from Sony's site. I used this one.

  • Download a prebuilt toolchain:

    git clone --depth=1 https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7/
    
  • Build the kernel image and the dtb:

    cd kernel
    mkdir ../out
    make ARCH=arm CROSS_COMPILE=/path/to/arm-eabi-4.7/bin/arm-eabi- O=../out msm8610_build_defconfig zImage msm8610-v2-mtp.dtb -j2
    

building the boot image

  • Get mkqcdtbootimg:

    git clone --depth=1 https://github.com/sonyxperiadev/mkqcdtbootimg
    cd mkqcdtbootimg
    make
    
  • Build the boot image:

    ./mkqcdtbootimg \
        --kernel /path/to/arch/arm/boot/zImage \
        --ramdisk /path/to/ramdisk.gz \
        --dt_dir /path/to/arch/arm/boot/ \
        --base 0x00000000 \
        --ramdisk_offset 0x2008000 \
        --kernel_offset 0x10000 \
        --tags_offset 0x1e08000 \
        --pagesize 2048 \
        --cmdline "androidboot.hardware=qcom user_debug=31 maxcpus=2 msm_rtb.filter=0x3F ehci-hcd.park=3 msm_rtb.enable=0 lpj=192598 dwc3.maximum_speed=high dwc3_msm.prop_chg_detect=Y" \
        -o boot.img
    

Flash it on the phone with fastboot.

getting ramdisk.gz

If you had root on your phone I suppose you get an image of the boot partition with something like...

dd if=/dev/block/platform/msm_sdcc.1/by-name/boot of=/sdcard/boot.img

... and then extract the ramdisk with this tool.

If you don't have root, you may have to use a certain closed-source application (written in C#) that will get a bunch of files from Sony's servers; one of those files will be a gzipped zip file (yes really), containing another file with a name like kernel-BLAH-BLAH.sin; then you'd use another closed-source application (this time written in Java) that will extract the ramdisk and qcdt images from this file.

rooting the phone

TODO

getting wi-fi to work

Ok, this took me a while to figure out...

You don't get wifi because the module wlan.ko is not compatible with the kernel you just compiled. You need to build a new one.

  • Get the source:

    git clone --depth=1 https://github.com/sonyxperiadev/prima
    
  • The module needs a dummy parameter qcom_reg (more on this later). Edit CORE/HDD/src/wlan_hdd_main.c and add the following to the bottom:

    static int qcom_reg = 0;
    module_param(qcom_reg, int, 0644);
    
  • Build the module:

    cd prima
    make ARCH=arm CROSS_COMPILE=/path/to/arm-eabi-4.7/bin/arm-eabi- -C /path/to/kernel/out M=$PWD CONFIG_PRONTO_WLAN=m CONFIG_PRIMA_WLAN_LFR=y KERNEL_BUILD=1 WLAN_ROOT=$PWD -j2
    
  • Copy wlan.ko to /system/lib/modules/pronto/pronto_wlan.ko on the phone.

  • Copy the following files from prima/firmware_bin to the phone:

    • WCNSS_cfg.dat to /system/etc/firmware/wlan/prima/
    • WCNSS_qcom_cfg.ini to /data/misc/wifi/
    • WCNSS_qcom_wlan_nv.bin to /data/misc/wifi/

About qcom_reg parameter: without this parameter, you'll notice that even though the module can be successfully loaded with insmod, it won't get loaded during startup. This happens because whoever tries to install the module (libhardware_legacy.so) is passing the parameter qcom_reg=0, which doesn't exist in the open-source version.

xperia-e1-kernel-patches's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.