I know that the repo is the development tree, and that the tip of the branch will be far ahead of the official kernel build. This is all fine and expected (and was seemingly[1] accounted for in the diffs I mentioned above)I've already said the repo is the same kernel but the development tree. It will have numerous changes that haven't made it into the stable repo kernel. Unsurprisingly, a month worth of changes is a large number of lines.So yeah, the intermediate conclusion is that the GH kernel is a completely different kernel, that we just publicly don't know how it relates to he officially built one.
What is not expected is following official kernel building docs, checking out specific commits that are said to be corresponding to the released official kernel builds, and then getting incompatible binaries.
It was absolutely not obvious that there are extra steps and extra patches applied to the kernel. And no matter how I asked about the exact steps needed to reproduce the official stable release builds, I couldn't get an answer.
Anyway, ultimately, I figured it out.
The official kernel contains at least two sets of patches: one from debian, and one baked from a release-specific commit from the raspberrypi/linux repo. The RPi repo itself does not contain debian patches. They are applied separately. This debian set of patches is not that big, but also not trivial.
A simple way to get the debian patches is to use the `apt source <kernel-image-pkg>` command to download and prepare the sources. This command will leave its artifacts in the current directory. It will:
- Download `linux_6.6.20.orig.tar.xz` which is exactly the vanilla 6.6.20 kernel from kernel.org, no changes.
- Download `linux_6.6.20-1+rpt1.debian.tar.xz` which contains both sets of patches: debian and raspberry-pi specific, (and also scripts, and other misc stuff).
- Extract the vanilla kernel into `linux-6.6.20` dir, and apply [1]debian patches only. It will not apply raspberry pi-specific patches.
Code:
tar xf linux_6.6.20-1+rpt1.debian.tar.xz# The archive contains only a `debian` directorycd linux-6.6.20patch -p1 < ../debian/patches-rpi/rpi.patch
This is the same commit hash that can be found in:
- raspberrypi/firmware repo extra/git_hash file
- `debian/changelog` file: `* Linux commit: 6f16847710cc0502450788b9f12f0a14d3429668`
It's this one, which enables per-module BTF info unconditionally:
Code:
$ cat debian/patches/debian/module-avoid-abi-changes-when-debug-info-is-disabled.patch...--- a/include/linux/module.h+++ b/include/linux/module.h@@ -471,7 +471,7 @@ struct module { unsigned int num_bpf_raw_events; struct bpf_raw_event_map *bpf_raw_events; #endif-#ifdef CONFIG_DEBUG_INFO_BTF_MODULES+#if 1 unsigned int btf_data_size; void *btf_data; #endif
I haven't looked at other symbols CRCs, at this point I just hope that there are no more layers to this whole situation.
Statistics: Posted by provod — Mon Apr 08, 2024 10:55 pm