account arrowhead-down arrowhead-up cart mobile-menu search sm-bold-x x-skinny-rounded x-skinny arrowhead-right social-facebook social-googleplus social-instagram social-linkedin social-pinterest social-qzone social-renren social-tencent social-twitter social-vkontakt social-weibo social-youku social-youtube

Please help us improve our website

Take our customer survey to evaluate your visit.

It should only take a few minutes to answer five quick questions. Just click the Launch survey button at the end of your visit to begin.

cancel
Showing results for 
Search instead for 
Did you mean: 
Welcome to the Open Devices community!

This is where we discuss open source and development related questions on our Open Devices initiative.

M4 Aqua , bootloop when using copyleft sources

SOLVED
Regular
Message 1 of 9
1,808 Views
Message 1 of 9

M4 Aqua , bootloop when using copyleft sources

Hello. I'm trying to compile custom kernel to E2303.

I tried Google aarch64 4.9 toolchain and UBER Toolchain 4.9.

Compilation finishes without any error. Even 'Image'is same size as stock kernel Image

I repack boot.img using mkqcdtbootimg and mkboot (both of them leads to same result Slightly frowning Face ) .

Flashed boot.img using fastboot.

After 'fastboot reboot' SONY logo comes out . Waits around 15-25 sec . Then restarts again. Weird thing is device connects as mtp before restart. So i think kernel is OK but something else isn't. I also tried to disable dm-verity and selinux still no luck.

Unpacking then repacking boot.img without any modification works. 

I'm not sure what i'm doing wrong.

I'd appreciate any help.Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Regular
Message 9 of 9
2,227 Views
Message 9 of 9

Re: M4 Aqua , bootloop when using copyleft sources

I fixed the problem by myself. Nobody told me about it could be toolchain because kernel was booting but os wasnt. But somehow up-dated aarch64 4.9 toolchain doesnt works with m4 aqua copyleft kernel. So i found exactly same toolchain according to date . Now it works. Nobody in sony helps so if anybody wants to compile and boot coplyeft kernel on this device , i am explaining how to do it now.

Use this toolchain  : https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/...

extract ramdisk using your favourite tool.

Compile kernel with toolchain that i pasted using msm-perf_defconfig

Copy all dtb files in /arch/arm/boot/dts/ to /arch/arm64/boot/dts/

recompile kernel without using mrproper or clean . This time we will have image.gz-dtb in arch/arm64/boot folder while we didnt had in previous compilation attempt.

 

Download mkbootimg tools. Copy your ramdisk.cpio and image.gz-dtb to same folder with mkbootimg.

 

open terminal and cd to folder of mkbootimg. Repack boot using this command :

./mkbootimg --kernel Image.gz-dtb --cmdline "console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3 androidboot.bootdevice=7824900.sdhci lpm_levels.sleep_disabled=1 earlyprintk androidboot.selinux=permissive" --ramdisk ramdisk.cpio --base 0x80000000 --pagesize 2048 --ramdisk_offset 0x02000000 --tags_offset 0x01E00000 --output last.img

Now you can flash last.img using fastboot flash boot last.img

I hope it works for you. Because i was trying to boot this kernel like 35-45 days but now i have found the solution

8 REPLIES 8
Developer World
Message 2 of 9
1,763 Views
Message 2 of 9

Re: M4 Aqua , bootloop when using copyleft sources

Hi,

the M4 Aqua uses the regular appended dtb kernel and you should not use the mkqcdtbootimg and mkboot.

 

Another possible issue are errors with slinux and/or dm-verity. I would advice you to turn selinux to permissive in the cmdline and then try to boot again.

 

Regards

Alin

 

Regular
Message 3 of 9
1,756 Views
Message 3 of 9

Re: M4 Aqua , bootloop when using copyleft sources

Thanks for reply. 

What should i use for packaging boot.img ?

Regular
Message 4 of 9
1,663 Views
Message 4 of 9

Re: M4 Aqua , bootloop when using copyleft sources

Okay. I started over. Unpacked boot.img , repacked using mkbootimg (using this command) ;

./mkbootimg --kernel Image.gz-dtb --cmdline "console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3 androidboot.bootdevice=7824900.sdhci lpm_levels.sleep_disabled=1 earlyprintk androidboot.selinux=permissive" --ramdisk ramdisk.cpio --base 0x80000000 --pagesize 2048 --ramdisk_offset 0x02000000 --tags_offset 0x01E00000 --output last.img

 

its still same. As i said , its recognized by pc and even with adb.

Here is my logcat : https://ghostbin.com/paste/83thj

 

Not sure what is wrong. But i guess something is wrong with ramdisk . Where can i get pure ramdisk ? Tried AndroidImageKitchen and mkboot. Ramdisk seems ok when i checked it in ubuntu.

Regular
Message 5 of 9
1,629 Views
Message 5 of 9

Re: M4 Aqua , bootloop when using copyleft sources

update : phone just booted when i tried AOSP kernel (branch:  LA.BR.1.3.3_rb2.14). Device passes logo but this time stucks at bootanim. I really need help. Is there any problem on  github copyleft sources ? What i am doing wrong. This is getting more annoying day by day.

I will try kernel from open source archive. Probably it won't work either.

Somebody help please. I'm stuck

Developer World
Message 6 of 9
1,604 Views
Message 6 of 9

Re: M4 Aqua , bootloop when using copyleft sources

Hi,

 

the kernel must match your Android version.

 

Pleas note that the Open Devices kernel is not compatible with the Sony SW.

 

If you have adb you should try to get logs (dmesg and logcat) and check why it fails to boot

 

Regards

Alin

Regular
Message 7 of 9
1,594 Views
Message 7 of 9

Re: M4 Aqua , bootloop when using copyleft sources

i already posted logcat on my older reply. 

here it is : https://ghostbin.com/paste/83thj

Log belongs to my attempt of building this branch : https://github.com/sonyxperiadev/kernel-copyleft/tree/26.3.A.1.xxx

config is arch/arm64/configs/msm-perf_defconfig

i am using Google's android aarch64 4.9 toolchain.

Repacked boot.img using this command 

./mkbootimg --kernel Image.gz-dtb --cmdline "console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3 androidboot.bootdevice=7824900.sdhci lpm_levels.sleep_disabled=1 earlyprintk androidboot.selinux=permissive" --ramdisk ramdisk.cpio --base 0x80000000 --pagesize 2048 --ramdisk_offset 0x02000000 --tags_offset 0x01E00000 --output last.img

 

Logo comes , recognized by pc , after few sec it reboots again.

Regular
Message 8 of 9
1,549 Views
Message 8 of 9

Re: M4 Aqua , bootloop when using copyleft sources

Still waiting hopeless Slightly frowning Face after few hours of attempt kernel still doesnt works. I tried open source archive , no success. Changed mkbootimg command for a dozen time still no success. Changed toolchain , still no success.

I am so stuck at this moment. Help...

Regular
Message 9 of 9
2,228 Views
Message 9 of 9

Re: M4 Aqua , bootloop when using copyleft sources

I fixed the problem by myself. Nobody told me about it could be toolchain because kernel was booting but os wasnt. But somehow up-dated aarch64 4.9 toolchain doesnt works with m4 aqua copyleft kernel. So i found exactly same toolchain according to date . Now it works. Nobody in sony helps so if anybody wants to compile and boot coplyeft kernel on this device , i am explaining how to do it now.

Use this toolchain  : https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/...

extract ramdisk using your favourite tool.

Compile kernel with toolchain that i pasted using msm-perf_defconfig

Copy all dtb files in /arch/arm/boot/dts/ to /arch/arm64/boot/dts/

recompile kernel without using mrproper or clean . This time we will have image.gz-dtb in arch/arm64/boot folder while we didnt had in previous compilation attempt.

 

Download mkbootimg tools. Copy your ramdisk.cpio and image.gz-dtb to same folder with mkbootimg.

 

open terminal and cd to folder of mkbootimg. Repack boot using this command :

./mkbootimg --kernel Image.gz-dtb --cmdline "console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3 androidboot.bootdevice=7824900.sdhci lpm_levels.sleep_disabled=1 earlyprintk androidboot.selinux=permissive" --ramdisk ramdisk.cpio --base 0x80000000 --pagesize 2048 --ramdisk_offset 0x02000000 --tags_offset 0x01E00000 --output last.img

Now you can flash last.img using fastboot flash boot last.img

I hope it works for you. Because i was trying to boot this kernel like 35-45 days but now i have found the solution