Closed GuillaumeRossolini closed 1 year ago
Not quite. You should consider the line which calculates the offset:
IMG_OFFSET=$(LC_ALL=C grep -abo $'\x1f\x8b\x08\x00' $ZIMAGE | head -n 1 | cut -d ':' -f 1)
Which is then used in the version extraction. I don't know where 1f 8b 08 00 comes from, but that may need changing in 6.x . Or say, needs head -n 2 | tail -n 1
to select the 2nd value instead of the first with head -n 1
.
Slightly better fix : https://github.com/HinTak/seeed-voicecard/commit/a57389693ceae6daabd2a78ce488795a8d0125dd - see log message for explanation.
A slightly longer explanation: those text extraction hacks basically looks for the first line of the boot up message, which is baked into the kernel, reporting its own version and what compiler was used etc.
It is among other boot messages, and each message tend to have a new line at the end. Logically it is the first message printed, but structurally it used to be in the middle among others in 5.x . It seems to be the first structurally too in 6.x, so before it, is just other executable structures, like routine names, without a newline separating.
Such rearrangements happen sometimes because of actual code change (blocks of message definitions moved / re-arranged), sometimes change in compiler and / or optimization level. So it is probably surprising how it works well for a few years. This breakage s probably either an actual person optimising the code (rearranging messages in order of their actual usage) or compiler optimized.
A naive question: why not use something like uname -r
instead? Seems like it outputs the string the install script needs.
I think I use it in mine. But it is a 3-way problem: the running kernel, the installed kernel, and the installed header. Right after a general "apt upgrade" , they don't necessarily agree. I think I would abort and recommend a reboot; but the dkms system is supposed to rebuild after next reboot, so historically the important version is the installed kernel (which is the one used after reboot), rather than the current running kernel before reboot.
Also the pi people are not very consistent between kernel self-reported version (from uname -r) vs the packaging (mostly time date snapshotted)
Thanks for all the interesting information!
The following is using HinTak's repository on the v6.1 branch, on a Raspberry Pi Zero W with the Raspberry Pi OS Lite (32-bit) image.
Executing ./install.sh on a raspberry zero w, recently reimaged, with barely anything installed on top of the default image (certainly nothing kernel-related), results in errors along these lines:
The above is a trimmed log, and the script then tries to apply kernel headers that don't match my system. I then get a scary fullscreen warning that tells me to please reboot, but when I do and reinstall, the same happens.
I'll focus on these warnings from the log above (and the messages that follow):
From what I understand, the issue is with the
get_kernel_version()
macro and specifically this line:When this gets piped into
awk
, a lot of empty lines stay in the output, confusing thedpkg
commands later on.aplay whatever.wav
still works without this.I'm not sure this is the best fix, or if it should be applied in other scripts.