Bug#1080340: initramfs-tools does not use include firmware named in the devicetree
Hi,
I found that the hook is also necessary on the t14s. However, I needed to tweak it slightly.
My devicetree (from kernel 6.18-rc7) has a couple of firmware-files entries with 2 filenames, like this:
remoteproc@6800000 {
compatible = "qcom,x1e80100-adsp-pas";
[...]
status = "okay";
firmware-name = "qcom/x1e80100/LENOVO/21N1/qcadsp8380.mbn", "qcom/x1e80100/LENOVO/21N1/adsp_dtbs.elf";
sysfs represents it as a file containing two null-terminated strings:
# hexdump -C /sys/firmware/devicetree/base/soc\@0/remoteproc\@6800000/firmware-name
00000000 71 63 6f 6d 2f 78 31 65 38 30 31 30 30 2f 4c 45 |qcom/x1e80100/LE|
00000010 4e 4f 56 4f 2f 32 31 4e 31 2f 71 63 61 64 73 70 |NOVO/21N1/qcadsp|
00000020 38 33 38 30 2e 6d 62 6e 00 71 63 6f 6d 2f 78 31 |8380.mbn.qcom/x1|
00000030 65 38 30 31 30 30 2f 4c 45 4e 4f 56 4f 2f 32 31 |e80100/LENOVO/21|
00000040 4e 31 2f 61 64 73 70 5f 64 74 62 73 2e 65 6c 66 |N1/adsp_dtbs.elf|
00000050 00 |.|
Using "cat" dropped the null, causing the two paths to be concatenated together.
Ultimately, it produced a warning for the nonexistent file
"qcom/x1e80100/LENOVO/21N1/qcadsp8380.mbnqcom/x1e80100/LENOVO/21N1/adsp_dtbs.elf".
I changed the script's loop to use "strings", instead of "cat":
for node in $(find /sys/firmware/devicetree -name firmware-name); do
for firmware in $(strings "${node}"); do
if ! add_firmware "${firmware}"; then
echo "W: Possible missing firmware /lib/firmware/${firmware}
found in devicetree" >&2
fi
done
done
And now it works great.
Thanks,
Mark
Reply to: