[PROJECT][EXPERIMENTAL] Linux kernel 3.18.31 for Xiaomi Mi A1 (tissot)

Search This thread

cute_prince

Inactive Recognized Developer
May 19, 2012
782
4,300
Trivandrum
Since Xiaomi has not released the kernel sources yet, I'm currently trying to port Redmi Note 4 (mido) kernel sources for Mi A1. The porting process may succeed because both these devices are based on same architecture and comes from the same manufacturer. I have shared my kernel sources and those who wanna contribute may send pull request to the same. I'm currently looking for testers and those who wants to volunteer please reply in this thread.

You can test with stock rom or TWRP recovery.
Steps for testing:
1. Download TWRP recovery / boot image of stock rom.
2. Unpack it and replace the prebuilt kernel with our testing kernel.
3. Repack it and reboot phone to fastboot mode.
4. Type fastboot boot <repacked_image_name.img>
5. If it boots, post here the dmesg and other helpful logs ;)

Status [Working]
Boots
Display
WiFi
Touchscreen
RIL
Vibration
IR
Bluetooth
Sensors
SD card
MTP
Charging

XDA:DevDB Information
Linux kernel 3.18.31 for Xiaomi Mi A1 (tissot), Kernel for the Xiaomi Mi A1

Contributors
cute_prince, @ur0
Source Code: https://github.com/cuteprince/android_kernel_xiaomi_msm8953

Version Information
Status: Testing

Created 2017-12-02
Last Updated 2017-12-02
 
Last edited:

sooti

Recognized Developer
Jan 26, 2012
2,537
6,764
Nah... doesn't boot.. while it's true that we share the same SD625 with many other xiaomi devices, there are other things to consider here... different display, camera, etc... not a kernel expert but just what i think...
anyway thanks for the attempt... i'm sure Xiaomi will release the sources soon, they might be waiting for Oreo since there are some specific commits that only apply to oreo, if so, they are actually kinda doing us a favor, since they always release the kernel once and never bother updating the sources since...
 

SevenSlevin

Senior Member
Aug 16, 2016
182
123
Yes I think it works. I've done it and boot on system, in system I have different kernel.
The stock is from 17/11/2017 and yours is 02/12/2017.
edit: fingerprint doesnt work
camera doesnt work (it opens but see only black screen)
led doesn't work

edit2: link dmesg https://mega.nz/#!JcBjjCSA!_xzviwYuyRBfOmmpx8eDPa9Q8Uvwn_uRu0Usx-w8Y1g
I dont know how to put it here so I've used my mega account, if have problem I can use google driver or dropbox
 
Last edited:

sooti

Recognized Developer
Jan 26, 2012
2,537
6,764
Yes I think it works. I've done it and boot on system, in system I have different kernel.
The stock is from 17/11/2017 and yours is 02/12/2017.
edit: fingerprint doesnt work
Odd... Didn't boot for me.. maybe I missed something

I see why the FP failed... the selinux is denied it, OP needs to set it to permissive
 
Last edited:

sooti

Recognized Developer
Jan 26, 2012
2,537
6,764
OK, got it to boot, great work OP! this could give us some lead until Xiaomi releases kernel source.

EDIT: so as I said earlier, selinux needs to be disabled for now... otherwise wifi, fingerprint, audio and LED don't work...
 
Last edited:

cute_prince

Inactive Recognized Developer
May 19, 2012
782
4,300
Trivandrum
Yes I think it works. I've done it and boot on system, in system I have different kernel.
The stock is from 17/11/2017 and yours is 02/12/2017.
edit: fingerprint doesnt work
camera doesnt work (it opens but see only black screen)
led doesn't work

edit2: link dmesg https://mega.nz/#!JcBjjCSA!_xzviwYuyRBfOmmpx8eDPa9Q8Uvwn_uRu0Usx-w8Y1g
I dont know how to put it here so I've used my mega account, if have problem I can use google driver or dropbox

Great :). So it booted the stock rom. Did you tried disabling Selinux ? What about wifi, vibration, audio, bt, ir etc ? Are they working ?
 

Hellrazoraj

Senior Member
Jun 20, 2016
215
49
Thanks for testing. Are they working (wifi, bt, ir, led etc) after disabling selinux ?

This is very good progress..thank u OP.i will try this out but could you tell me how much it will affect the performance?? If there any noticeable difference? Cause as it's a Redmi note 4 kernel the battery in rn4 is 4000mah.

---------- Post added at 05:46 AM ---------- Previous post was at 05:45 AM ----------

Oh wow Xioami is really slacking huh.
They r slacking very badly..they have too many products rolled out & developer team size might not be that big it seems due to which many things r not happening in the right manner.
 

cute_prince

Inactive Recognized Developer
May 19, 2012
782
4,300
Trivandrum
This is very good progress..thank u OP.i will try this out but could you tell me how much it will affect the performance?? If there any noticeable difference? Cause as it's a Redmi note 4 kernel the battery in rn4 is 4000mah.

No problem. This kernel is using device tree file of Mi A1. So device specific configurations like battery, display etc are of Mi A1 itself.
 
  • Like
Reactions: Hellrazoraj

SevenSlevin

Senior Member
Aug 16, 2016
182
123
don't work:
wifi, audio, camera, fingerprint, led notification, audio in jack earphones

work:
ril, ir, bluetooth, vibrate, audio in bluetooth earphones

I havent done nothing on Twrp recovery, I've just changed kernel like on description.
 
Last edited:

FrenzyR

Senior Member
Aug 20, 2014
385
528
chennai
error while compiling
C drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_api.o
CC drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_device.o
CC drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_msg.o
CC drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_packet.o
CC drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_sync.o
CC drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_timer.o
CC drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_trace.o
LD drivers/staging/prima/wlan.o
LD drivers/staging/prima/built-in.o
LD drivers/staging/built-in.o
LD drivers/built-in.o
LINK vmlinux
LD vmlinux.o
MODPOST vmlinux.o
GEN .version
CHK include/generated/compile.h
UPD include/generated/compile.h
CC init/version.o
LD init/built-in.o
KSYM .tmp_kallsyms1.o
KSYM .tmp_kallsyms2.o
LD vmlinux
SORTEX vmlinux
SYSMAP System.map
make[2]: *** No rule to make target 'arch/arm64/boot/dts/msm8953-qrd-sku3-d2.dtb', needed by 'arch/arm64/boot/Image.gz-dtb'. Stop.
make[2]: *** Waiting for unfinished jobs....
OBJCOPY arch/arm64/boot/Image
/home/ramesh/li/kernel/xiaomi/msm8953/arch/arm64/Makefile:98: recipe for target 'Image.gz-dtb' failed
make[1]: *** [Image.gz-dtb] Error 2
make[1]: Leaving directory '/home/ramesh/li/out/target/product/tissot/obj/KERNEL_OBJ'
Makefile:145: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2
make: Leaving directory '/home/ramesh/li/kernel/xiaomi/msm8953'
[ 20% 9987/49431] host C: libicuuc-host <= external/icu/icu4c/source/common/umapfile.c
[ 20% 9987/49431] host C: libicuuc-host <= external/icu/icu4c/source/common/usc_impl.c
[ 20% 9987/49431] host C: libicuuc-host <= external/icu/icu4c/source/common/utrace.c
[ 20% 9987/49431] host C: libicuuc-host <= external/icu/icu4c/source/common/utypes.c
[ 20% 9987/49431] host C: libicuuc-host <= external/icu/icu4c/source/common/wintz.c
[ 20% 9987/49431] Export includes file: -- /home/ramesh/li/out/host/linux-x86/obj/SHARED_LIBRARIES/libicui18n-host_intermediates/export_includes
[ 20% 9987/49431] Export includes file: -- /home/ramesh/li/out/host/linux-x86/obj/STATIC_LIBRARIES/libfdlibm_intermediates/export_includes
ninja: build stopped: subcommand failed.
build/core/ninja.mk:151: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
make: Leaving directory '/home/ramesh/li'

#### make failed to build some targets (12:37 (mm:ss)) ####

Build step 'Execute shell' marked build as failure
FTP: Current build result is [FAILURE], not going to run.
Finished: FAILURE
 

cute_prince

Inactive Recognized Developer
May 19, 2012
782
4,300
Trivandrum
error while compiling
C drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_api.o
CC drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_device.o
CC drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_msg.o
CC drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_packet.o
CC drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_sync.o
CC drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_timer.o
CC drivers/staging/prima/CORE/WDI/WPAL/src/wlan_qct_pal_trace.o
LD drivers/staging/prima/wlan.o
LD drivers/staging/prima/built-in.o
LD drivers/staging/built-in.o
LD drivers/built-in.o
LINK vmlinux
LD vmlinux.o
MODPOST vmlinux.o
GEN .version
CHK include/generated/compile.h
UPD include/generated/compile.h
CC init/version.o
LD init/built-in.o
KSYM .tmp_kallsyms1.o
KSYM .tmp_kallsyms2.o
LD vmlinux
SORTEX vmlinux
SYSMAP System.map
make[2]: *** No rule to make target 'arch/arm64/boot/dts/msm8953-qrd-sku3-d2.dtb', needed by 'arch/arm64/boot/Image.gz-dtb'. Stop.
make[2]: *** Waiting for unfinished jobs....
OBJCOPY arch/arm64/boot/Image
/home/ramesh/li/kernel/xiaomi/msm8953/arch/arm64/Makefile:98: recipe for target 'Image.gz-dtb' failed
make[1]: *** [Image.gz-dtb] Error 2
make[1]: Leaving directory '/home/ramesh/li/out/target/product/tissot/obj/KERNEL_OBJ'
Makefile:145: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2
make: Leaving directory '/home/ramesh/li/kernel/xiaomi/msm8953'
[ 20% 9987/49431] host C: libicuuc-host <= external/icu/icu4c/source/common/umapfile.c
[ 20% 9987/49431] host C: libicuuc-host <= external/icu/icu4c/source/common/usc_impl.c
[ 20% 9987/49431] host C: libicuuc-host <= external/icu/icu4c/source/common/utrace.c
[ 20% 9987/49431] host C: libicuuc-host <= external/icu/icu4c/source/common/utypes.c
[ 20% 9987/49431] host C: libicuuc-host <= external/icu/icu4c/source/common/wintz.c
[ 20% 9987/49431] Export includes file: -- /home/ramesh/li/out/host/linux-x86/obj/SHARED_LIBRARIES/libicui18n-host_intermediates/export_includes
[ 20% 9987/49431] Export includes file: -- /home/ramesh/li/out/host/linux-x86/obj/STATIC_LIBRARIES/libfdlibm_intermediates/export_includes
ninja: build stopped: subcommand failed.
build/core/ninja.mk:151: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
make: Leaving directory '/home/ramesh/li'

#### make failed to build some targets (12:37 (mm:ss)) ####

Build step 'Execute shell' marked build as failure
FTP: Current build result is [FAILURE], not going to run.
Finished: FAILURE

Hi, you have to symlink arch/arm/boot/dts/msm8953-qrd-sku3-d2.dtb file to arch/arm64/boot/dts/msm8953-qrd-sku3-d2.dtb
While pushing my sources, git ignored that symlink thats why build is failing for you.
 

cute_prince

Inactive Recognized Developer
May 19, 2012
782
4,300
Trivandrum
don't work:
wifi, audio, camera, fingerprint, led notification, audio in jack earphones

work:
ril, ir, bluetooth, vibrate, audio in bluetooth earphones

I havent done nothing on Twrp recovery, I've just changed kernel like on description.

As @sooti suggested I'll build another image with selinux disabled. Lets see if selinux is causing the issue. Also can you test whether sensors are working using cpu-z app ?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 64
    Since Xiaomi has not released the kernel sources yet, I'm currently trying to port Redmi Note 4 (mido) kernel sources for Mi A1. The porting process may succeed because both these devices are based on same architecture and comes from the same manufacturer. I have shared my kernel sources and those who wanna contribute may send pull request to the same. I'm currently looking for testers and those who wants to volunteer please reply in this thread.

    You can test with stock rom or TWRP recovery.
    Steps for testing:
    1. Download TWRP recovery / boot image of stock rom.
    2. Unpack it and replace the prebuilt kernel with our testing kernel.
    3. Repack it and reboot phone to fastboot mode.
    4. Type fastboot boot <repacked_image_name.img>
    5. If it boots, post here the dmesg and other helpful logs ;)

    Status [Working]
    Boots
    Display
    WiFi
    Touchscreen
    RIL
    Vibration
    IR
    Bluetooth
    Sensors
    SD card
    MTP
    Charging

    XDA:DevDB Information
    Linux kernel 3.18.31 for Xiaomi Mi A1 (tissot), Kernel for the Xiaomi Mi A1

    Contributors
    cute_prince, @ur0
    Source Code: https://github.com/cuteprince/android_kernel_xiaomi_msm8953

    Version Information
    Status: Testing

    Created 2017-12-02
    Last Updated 2017-12-02
    46
    Finally, after spending countless hours reverse engineering stock kernel with hex editing tools I successfully extracted the firmware required for our touch panels to work properly. It was a really daunting task but got all the needed firmware files :). Will publish a new boot image for testing tomorrow :)
    38
    I've managed to fix audio. I'll be sending the pull request on Monday.

    I guess the camera's the next challenge.
    30
    Thread cleaned

    Development thread sort of gives it away. Please only post development related posts.
    There is no need to say thanks, or post that you clicked thanks
    There is no need to ask for ETAs
    There is no need to ask for current status, that's in the OP
    There is no need to reply to these kind of posts
    There is no need to argue in a public forum.

    Greg
    24
    @cute_prince
    Your kernel source works, touchscreen is almost unusable but it boots my lineage build

    Do not ask for an ETA or testers please in its current state its worthless due to the touchscreen being pretty much broken

    20171203_222402.jpg
    20171203_225601.jpg