Jump to content

Need help to compile dt img from kernel source of oneplus2


Guest k2wl

Recommended Posts

@KonstaT

hello sir!!! how are you

can you please help me compile dt image from kernel source of oneplus 2

https://github.com/k2wl/android_kernel_oneplus_msm8994

 

every time the dt image creation failed...

in this source oneplus actully put hardware ids as folders in arch/arm64/boot/dts

here i think all of the dt image required files are present.

here is device tree i am trying to compile with.

although this deice tree by default uses prebuilt dt.img

i modify the boardconfig.mk lines for building it from source.

https://github.com/Grarak/android_device_oneplus_oneplus2

thank you for your patient time...

 

 

Edited by k2wl
Link to comment
Share on other sites

Guest KonstaT

Fails how?

Quick guess would be that it needs dtbTool v3 (qcom,pmic-id support which CM's doesn't have). It's there on OP2's CAF tag (LA.BF64.1.2.1.c1-00810-8x94).
https://www.codeaurora.org/cgit/quic/la/device/qcom/common/commit/?h=LA.BF64.1.2.1.c1_rb1.5&id=1b0556065535cee39dc77d26bee37a4561936827

I think I already saw some OP2 specific patch in CM gerrit but can't remember what it was. BTW is there a stock boot.img somewhere I could have a look?

Link to comment
Share on other sites

thank you sir for your quick reply.

https://www.androidfilehost.com/?fid=24052804347805620

this is stock boot.img

 

also i will look into the dtb tool v3 .

 

UPDATE- compile with v3 tool fails with following errors

 

  Output file: '/run/media/k2wlxda/5fd982c3-b9a5-417c-96ac-353be1e5f0c5/k2wlxda/cm-source/cm12/out/target/product/oneplus2/dt.img'
Found file: msm8994-v1-mtp_14049_HW_11.dtb ...
Version:3
... skip, incorrect 'qcom,board-id = <' format
skip, failed to scan for 'qcom,msm-id = <', 'qcom,board-id = <' or 'qcom,pmic-id = <' tag
Found file: msm8994-v2.0-mtp_14049_HW_11.dtb ...
Version:3
... skip, incorrect 'qcom,board-id = <' format
skip, failed to scan for 'qcom,msm-id = <', 'qcom,board-id = <' or 'qcom,pmic-id = <' tag
Found file: msm8994-v2.1-mtp_14049_HW_11.dtb ...
Version:3
... skip, incorrect 'qcom,board-id = <' format
skip, failed to scan for 'qcom,msm-id = <', 'qcom,board-id = <' or 'qcom,pmic-id = <' tag
Found file: msm8994-v1-mtp_14049_HW_12.dtb ...
Version:3
... skip, incorrect 'qcom,board-id = <' format
skip, failed to scan for 'qcom,msm-id = <', 'qcom,board-id = <' or 'qcom,pmic-id = <' tag
Found file: msm8994-v2.0-mtp_14049_HW_12.dtb ...
Version:3
... skip, incorrect 'qcom,board-id = <' format
skip, failed to scan for 'qcom,msm-id = <', 'qcom,board-id = <' or 'qcom,pmic-id = <' tag
Found file: msm8994-v2.1-mtp_14049_HW_12.dtb ...
Version:3
... skip, incorrect 'qcom,board-id = <' format
skip, failed to scan for 'qcom,msm-id = <', 'qcom,board-id = <' or 'qcom,pmic-id = <' tag
Found file: msm8994-v1-mtp_14049_HW_13.dtb ...
Version:3
... skip, incorrect 'qcom,board-id = <' format
skip, failed to scan for 'qcom,msm-id = <', 'qcom,board-id = <' or 'qcom,pmic-id = <' tag
Found file: msm8994-v2.0-mtp_14049_HW_13.dtb ...
Version:3
... skip, incorrect 'qcom,board-id = <' format
skip, failed to scan for 'qcom,msm-id = <', 'qcom,board-id = <' or 'qcom,pmic-id = <' tag
Found file: msm8994-v2.1-mtp_14049_HW_13.dtb ...
Version:3
... skip, incorrect 'qcom,board-id = <' format
skip, failed to scan for 'qcom,msm-id = <', 'qcom,board-id = <' or 'qcom,pmic-id = <' tag
Found file: msm8994-v1-mtp_14049_HW_14.dtb ...
Version:3
... skip, incorrect 'qcom,board-id = <' format
skip, failed to scan for 'qcom,msm-id = <', 'qcom,board-id = <' or 'qcom,pmic-id = <' tag
Found file: msm8994-v2.0-mtp_14049_HW_14.dtb ...
Version:3
... skip, incorrect 'qcom,board-id = <' format
skip, failed to scan for 'qcom,msm-id = <', 'qcom,board-id = <' or 'qcom,pmic-id = <' tag
Found file: msm8994-v2.1-mtp_14049_HW_14.dtb ...
Version:3
... skip, incorrect 'qcom,board-id = <' format
skip, failed to scan for 'qcom,msm-id = <', 'qcom,board-id = <' or 'qcom,pmic-id = <' tag
=> Found 0 unique DTB(s)

 

Edited by k2wl
Link to comment
Share on other sites

Guest KonstaT

You're doing it wrong. :P

dtbTool v3 does successfully create an image but only 3/12 of dtbs are accepted as unique. Resulting image is only ~850kb (vs. 3.4mb on stock).

Start DT image: /media/sda4/android/cm12.1/out/target/product/oneplus2/dt.img
Target dt image: /media/sda4/android/cm12.1/out/target/product/oneplus2/dt.img
DTB combiner:
  Input directory: '/media/sda4/android/cm12.1/out/target/product/oneplus2/obj/KERNEL_OBJ/arch/arm64/boot/dts/'
  Output file: '/media/sda4/android/cm12.1/out/target/product/oneplus2/dt.img'
Found file: msm8994-v2.1-mtp_14049_HW_12.dtb ... 
Version:3
chipset: 207, rev: 131073, platform: 8, subtype: 0, pmic0: 65545, pmic1: 65546, pmic2: 0, pmic3: 0
Found file: msm8994-v2.0-mtp_14049_HW_13.dtb ... 
Version:3
chipset: 207, rev: 131072, platform: 8, subtype: 0, pmic0: 65545, pmic1: 65546, pmic2: 0, pmic3: 0
Found file: msm8994-v2.0-mtp_14049_HW_14.dtb ... 
Version:3
chipset: 207, rev: 131072, platform: 8, subtype: 0, pmic0: 65545, pmic1: 65546, pmic2: 0, pmic3: 0
... duplicate info, skipped
Found file: msm8994-v2.0-mtp_14049_HW_11.dtb ... 
Version:3
chipset: 207, rev: 131072, platform: 8, subtype: 0, pmic0: 65545, pmic1: 65546, pmic2: 0, pmic3: 0
... duplicate info, skipped
Found file: msm8994-v2.1-mtp_14049_HW_14.dtb ... 
Version:3
chipset: 207, rev: 131073, platform: 8, subtype: 0, pmic0: 65545, pmic1: 65546, pmic2: 0, pmic3: 0
... duplicate info, skipped
Found file: msm8994-v1-mtp_14049_HW_12.dtb ... 
Version:3
chipset: 207, rev: 65536, platform: 8, subtype: 0, pmic0: 65545, pmic1: 65546, pmic2: 0, pmic3: 0
Found file: msm8994-v1-mtp_14049_HW_14.dtb ... 
Version:3
chipset: 207, rev: 65536, platform: 8, subtype: 0, pmic0: 65545, pmic1: 65546, pmic2: 0, pmic3: 0
... duplicate info, skipped
Found file: msm8994-v1-mtp_14049_HW_11.dtb ... 
Version:3
chipset: 207, rev: 65536, platform: 8, subtype: 0, pmic0: 65545, pmic1: 65546, pmic2: 0, pmic3: 0
... duplicate info, skipped
Found file: msm8994-v1-mtp_14049_HW_13.dtb ... 
Version:3
chipset: 207, rev: 65536, platform: 8, subtype: 0, pmic0: 65545, pmic1: 65546, pmic2: 0, pmic3: 0
... duplicate info, skipped
Found file: msm8994-v2.0-mtp_14049_HW_12.dtb ... 
Version:3
chipset: 207, rev: 131072, platform: 8, subtype: 0, pmic0: 65545, pmic1: 65546, pmic2: 0, pmic3: 0
... duplicate info, skipped
Found file: msm8994-v2.1-mtp_14049_HW_13.dtb ... 
Version:3
chipset: 207, rev: 131073, platform: 8, subtype: 0, pmic0: 65545, pmic1: 65546, pmic2: 0, pmic3: 0
... duplicate info, skipped
Found file: msm8994-v2.1-mtp_14049_HW_11.dtb ... 
Version:3
chipset: 207, rev: 131073, platform: 8, subtype: 0, pmic0: 65545, pmic1: 65546, pmic2: 0, pmic3: 0
... duplicate info, skipped
=> Found 3 unique DTB(s)

Generating master DTB... completed
Made DT image: /media/sda4/android/cm12.1/out/target/product/oneplus2/dt.img

After hacking dtbTool to read qcom,hw-version none of the dtbs are skipped anymore.

Start DT image: /media/sda4/android/cm12.1/out/target/product/oneplus2/dt.img
Target dt image: /media/sda4/android/cm12.1/out/target/product/oneplus2/dt.img
DTB combiner:
  Input directory: '/media/sda4/android/cm12.1/out/target/product/oneplus2/obj/KERNEL_OBJ/arch/arm64/boot/dts/'
  Output file: '/media/sda4/android/cm12.1/out/target/product/oneplus2/dt.img'
Found file: msm8994-v2.1-mtp_14049_HW_12.dtb ... 
Version:3
chipset: 207, rev: 131073, platform: 8, subtype: 0, pmic0: 65545, pmic1: 65546, pmic2: 0, pmic3: 0
Found file: msm8994-v2.0-mtp_14049_HW_13.dtb ... 
Version:3
chipset: 207, rev: 131072, platform: 8, subtype: 0, pmic0: 65545, pmic1: 65546, pmic2: 0, pmic3: 0
Found file: msm8994-v2.0-mtp_14049_HW_14.dtb ... 
Version:3
chipset: 207, rev: 131072, platform: 8, subtype: 0, pmic0: 65545, pmic1: 65546, pmic2: 0, pmic3: 0
Found file: msm8994-v2.0-mtp_14049_HW_11.dtb ... 
Version:3
chipset: 207, rev: 131072, platform: 8, subtype: 0, pmic0: 65545, pmic1: 65546, pmic2: 0, pmic3: 0
Found file: msm8994-v2.1-mtp_14049_HW_14.dtb ... 
Version:3
chipset: 207, rev: 131073, platform: 8, subtype: 0, pmic0: 65545, pmic1: 65546, pmic2: 0, pmic3: 0
Found file: msm8994-v1-mtp_14049_HW_12.dtb ... 
Version:3
chipset: 207, rev: 65536, platform: 8, subtype: 0, pmic0: 65545, pmic1: 65546, pmic2: 0, pmic3: 0
Found file: msm8994-v1-mtp_14049_HW_14.dtb ... 
Version:3
chipset: 207, rev: 65536, platform: 8, subtype: 0, pmic0: 65545, pmic1: 65546, pmic2: 0, pmic3: 0
Found file: msm8994-v1-mtp_14049_HW_11.dtb ... 
Version:3
chipset: 207, rev: 65536, platform: 8, subtype: 0, pmic0: 65545, pmic1: 65546, pmic2: 0, pmic3: 0
Found file: msm8994-v1-mtp_14049_HW_13.dtb ... 
Version:3
chipset: 207, rev: 65536, platform: 8, subtype: 0, pmic0: 65545, pmic1: 65546, pmic2: 0, pmic3: 0
Found file: msm8994-v2.0-mtp_14049_HW_12.dtb ... 
Version:3
chipset: 207, rev: 131072, platform: 8, subtype: 0, pmic0: 65545, pmic1: 65546, pmic2: 0, pmic3: 0
Found file: msm8994-v2.1-mtp_14049_HW_13.dtb ... 
Version:3
chipset: 207, rev: 131073, platform: 8, subtype: 0, pmic0: 65545, pmic1: 65546, pmic2: 0, pmic3: 0
Found file: msm8994-v2.1-mtp_14049_HW_11.dtb ... 
Version:3
chipset: 207, rev: 131073, platform: 8, subtype: 0, pmic0: 65545, pmic1: 65546, pmic2: 0, pmic3: 0
=> Found 12 unique DTB(s)

Generating master DTB... completed
Made DT image: /media/sda4/android/cm12.1/out/target/product/oneplus2/dt.img

Size of the image is slightly bigger than on stock (3,387,392 bytes vs. 3,354,624 bytes) but at least it's in the right ballpark. No idea if there's still other OnePlus strangeness that needs to be hacked or does this actually boot on a device. I can upload it if you have a device to test with.

Edit. It's actually exactly the same size (3,387,392 bytes) as what's in stock OxygenOS 2.0.2 OTA that was released today.

Edited by KonstaT
Link to comment
Share on other sites

can you upload dtb tool you hacked with mkbootimg.mk used...so that i can put it in device tree.

 

upload a dtimage you compiled with boot image...i will tell my friend to test.

it is my friend's device

 

you are awersome sir...thank you very much

Edited by k2wl
Link to comment
Share on other sites

Guest KonstaT

it worked..can you please send pull request to Grarak so that it can be fixed

Great. :D And you're sure about this (screenshot or it didn't happen :P)? I see you posted it to XDA but no one has replied...

I'll send a pull request when I get things cleaned up.

Edited by KonstaT
Link to comment
Share on other sites

some users over xda yet to confirm that it is working...i am in contact with them...but it was worked on my friend's op2

but i just want some of users must reconfirm before you post the code.

 

thank you again for your incredible work

Great. :D And you're sure about this (screenshot or it didn't happen :P)? I see you posted it to XDA but no one has replied...

I'll send a pull request when I get things cleaned up.

 

Edited by k2wl
Link to comment
Share on other sites

Guest KonstaT

Well, it wasn't something I meant for you just throw over at XDA without giving any explanation (hey, test this). Also makes me little suspicious of this 'friend' of yours (it's fine if someone who knows what he/she is doing actually tested it and confirmed it working).

Already sent a pull request over a day ago...

Link to comment
Share on other sites

sorry...but my friend was about to go to trip so he is unable to share a screenshot ..so i have made an explanation over xda..i hope someone will surely post a screenshot there...i have seen your pull request today only...thank you very much sir....sorry if i bothered you ...thank you again

Well, it wasn't something I meant for you just throw over at XDA without giving any explanation (hey, test this). Also makes me little suspicious of this 'friend' of yours (it's fine if someone who knows what he/she is doing actually tested it and confirmed it working).

Already sent a pull request over a day ago...

Link to comment
Share on other sites

Guest KonstaT

sorry...but my friend was about to go to trip so he is unable to share a screenshot ..so i have made an explanation over xda..i hope someone will surely post a screenshot there...i have seen your pull request today only...thank you very much sir....sorry if i bothered you ...thank you again

Heh, 'screenshot or it didn't happen' is a joke on the interwebs. :P I don't actually need a screenshot. I just need to know if it worked or not (for sure). And if it worked, why the need to post it to XDA at all?

Edited by KonstaT
Link to comment
Share on other sites

problem is he not good in technichal things so i just told him to flash with flashify and reboot..he just confirmed it that it is working...but i am not 100 % sure he did it right or not..because i have not seen it personally.

Link to comment
Share on other sites

Guest KonstaT

problem is he not good in technichal things so i just told him to flash with flashify and reboot..he just confirmed it that it is working...but i am not 100 % sure he did it right or not..because i have not seen it personally.

It takes a quite tech savvy person to unlock bootloader, install custom recovery, and install a custom ROM. Let alone run software that is still highly experimental as a daily driver. Or to restore a device after flashing a boot.img that doesn't boot...

ok one user from oneplus2 mailed me that the boot.img does not boot.

so it is not working

my friend does not do that right then...

sorry for all this sir

Yeah, I smelled bullshit as soon as I saw you posted it elsewhere (I really hope you remove those posts). This was last time you can expect any help from me. Thanks for wasting everyone's time.

Edited by KonstaT
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.