Bug 12544

Summary: kernel-module-xxx contain non-deterministic srcversion
Product: [Yocto Project Subprojects] Kernel Reporter: Juro Bystricky <juro.bystricky>
Component: linux-yoctoAssignee: Juro Bystricky <juro.bystricky>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: randy.macleod, richard.purdie
Version: 2.5   
Target Milestone: 2.5 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
diffoscope output comparing two builds. none

Description Juro Bystricky 2018-02-13 00:03:47 UTC
Created attachment 4206 [details]
diffoscope output comparing two builds.

Building the same modules in two different folders at two different times results in about 15 different kernel-module-lttng packages having different srcversions (please see the attached file). This makes no sense, as the source code for the modules should be identical, hence the srcversion as well.
This was only observed with meta-intel, without meta-intel the srcversion seems to be always the same.
Comment 1 Juro Bystricky 2018-03-29 14:58:58 UTC
This potentially affects all kernel modules, (problem is not to meta-intel specific, not lttng modules specific). If the build directory name is rather long, some files are basically skipped from checksum calculation. If the folder names are kept short, no problems are observed. Now that I can reproduce this, finding the culprit should be straightforward.
Comment 2 Juro Bystricky 2018-03-30 12:22:10 UTC
So I found the root cause (scripts/modpost.c - get_next_line): if a file line is longer than 4096 bytes, it is silently ignored. This is later on interpreted as EOF. The consequence being some source files are skipped and do not contribute to srcversion checksum.
Sent a patch to kernel build mailing list:
https://patchwork.kernel.org/patch/10318141/
Comment 3 Juro Bystricky 2018-04-04 15:58:29 UTC
Patch sent to ML:
https://patchwork.openembedded.org/patch/149757/