GalaticStryder / kernel_lge_msm8974

Lambda Kernel for the LG G2
http://forum.xda-developers.com/lg-g2/development/kernel-lambda-kernel-t3270424
Other
24 stars 13 forks source link

Host computer produces wrong images when the compilation is serialized #2

Closed GalaticStryder closed 7 years ago

GalaticStryder commented 7 years ago

Panorama: Well, looks like I need to fire this issue to keep track on this annoying error that doesn't seem arise from the kernel source code but some library update in host systems. As ARM debugging is limited, I'm not sure if that can be possible to arise from the devices' system or from the host system itself due to bad caching of DT nodes, generating the primary DT nodes without purging in the next compilation target.

Reproducing: Build the kernel using the script (or manually) for a given variant, flash it. Build it again, different name, new features and debugging will behave just like the previous one. If the variant has changed it will not boot or boot with major issues.

Example: After you flash B kernel version for Y target, the image won't change at all, it will remain A kernel version for an X target. Let's say you compile BETA 3 for D800 target, then compile BETA 4 for D802. The flashed BETA 4 will show up in dmesg/behavior as BETA 3 and screen will be unresponsive due to mismatching touch FW revision for the previous target (D800).

Debugging If you are building Lambda kernel, make a couple serialized builds with different names, let's say a BETA and an EXPERIMENTAL. Flash and run:

adb shell dmesg | grep Lambda

Will print the version, BETA afaik.

Flash the other one with different tag. Let's say STABLE, run:

adb shell dmesg | grep Lambda

The Linux version must change as per tag being exported as LOCALVERSION.

There's also the possibility of compiling a given variant that's not yours and then compiling the right one for your variant. Flash that right one, fire another dmesg as I mentioned earlier.

Sometimes it can also rollback to an ancient version of kernel even though you've flashed the latest one.

The utsrelease header should also match the running/flashed kernel. cat include/generated/utsrelease.h

Share your results.

GalaticStryder commented 7 years ago

Machine probing:

Arch Linux compiled BETA 3 today (morning) for D800 and in the afternoon for D802, on D802 touch panel firmware doesn't match and compilation date shows as in the morning. The utsrelease header is alright, though. Fedora 24 compiled an EXPERIMENTAL version 09/15 with Faux sound control and today an EXPERIMENTAL with the current state of lambda branch. The utsrelease header matches but the kernel version does not, shows up as version 09/15 and doesn't have the userspace code introduced recently.

Looks like the host is storing a wrong zImage somewhere and bringing it up in the flashable zip and this is not the script behavior.

GalaticStryder commented 7 years ago

zImage probing:

Looks like the hypothesis matches completely:

strings zImage | grep 2016

SMP PREEMPT Thu Sep 15 22:25:02 BRT 2016

The zImage was built just now, not four days ago. So zImage generation is step is the wrong one.

GalaticStryder commented 7 years ago

Possible solution

So far, changing the ccache approach to be used only for compilation testing instead of flashing the image generated itself. Because the image built without ccache cleaning (dirty compiling) will recover wrong assets and generate wrong images that won't match hardware and dtb. Don't flash those very fast images! Just answer Y for ccache cleaning step, this will take more time but will generate good images that will pass probing with:

strings zImage | grep 2016

Matching compilation time/date on my tests. If you flash that, it will work good as HEX strings from zImage are a good resource for those headers.

GalaticStryder commented 7 years ago

Solution seems to work

Serialized D801 and D802 build right now, outputs:

D801

strings zImage | grep 2016

1 SMP PREEMPT Tue Sep 20 14:25:13 BRT 2016

hd on Sep 20 2016 at 14:23:59 n Sep 19 09:44:57 20164

strings zImage | grep D801 o-Beta-D801 3.4.112-Lambda-Infinito-Beta-D801A

D802

strings zImage | grep 2016

1 SMP PREEMPT Tue Sep 20 14:38:26 BRT 2016

hd on Sep 20 2016 at 14:36:19 n Sep 19 09:44:57 20164

strings zImage | grep D802

o-Beta-D802 (D802b D8022,l 3.4.112-Lambda-Infinito-Beta-D802A

adb shell dmesg

[ 0.000000 / 01-01 00:00:00.000] Linux version 3.4.112-Lambda-Infinito-Beta-D802 (galatic@wildschwein) (gcc version 5.4.0 (crosstool-NG crosstool-ng-1.21.0-286-g6ac8e31 - PWR-CORE) ) #1 SMP PREEMPT Tue Sep 20 14:38:26 BRT 2016

This issue can be closed as per instructions in script and readme.