From 590d8aa4e39b6d1f1f6ec5a53d73919c607f9bb2 Mon Sep 17 00:00:00 2001 From: Juerg Haefliger Date: Fri, 13 Sep 2024 07:45:55 +0200 Subject: [PATCH 1/2] WHENCE: Fix battmgr.jsn entry type Qcom jsons must not be compressed. Fixes: 541f96c0fa47b ("qcom: qcm6490: add ADSP and CDSP firmware") Signed-off-by: Juerg Haefliger --- WHENCE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WHENCE b/WHENCE index a8003643..3897121a 100644 --- a/WHENCE +++ b/WHENCE @@ -6127,7 +6127,7 @@ Version: ADSP.HT.5.5.c8-00149-KODIAK-1 RawFile: qcom/qcm6490/adspr.jsn RawFile: qcom/qcm6490/adsps.jsn RawFile: qcom/qcm6490/adspua.jsn -File: qcom/qcm6490/battmgr.jsn +RawFile: qcom/qcm6490/battmgr.jsn File: qcom/qcm6490/cdsp.mbn Version: CDSP.HT.2.5.c3-00077-KODIAK-1 RawFile: qcom/qcm6490/cdspr.jsn From 121e467fde66011caa2ff64b96738cbc68dc993e Mon Sep 17 00:00:00 2001 From: Juerg Haefliger Date: Fri, 13 Sep 2024 08:15:18 +0200 Subject: [PATCH 2/2] copy-firmware: Handle links to uncompressed files If copy-firwmware is told to compress files, it blindly assumes that the target is indeed compressed (unless it's a directory) and creates any symlinks accordingly. This leads to broken symlinks for links that point at RawFiles: adspr.jsn.zst -> ../qcm6490/adspr.jsn.zst adsps.jsn.zst -> ../qcm6490/adsps.jsn.zst That should be: adspr.jsn -> ../qcm6490/adspr.jsn adsps.jsn -> ../qcm6490/adsps.jsn Fix that by checking if the target (directory or file) exists. And while at it, add a check for broken symlinks at the end. Fixes: 541f96c0fa47b ("qcom: qcm6490: add ADSP and CDSP firmware") Signed-off-by: Juerg Haefliger --- copy-firmware.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/copy-firmware.sh b/copy-firmware.sh index 6757c6ce..6c557f23 100755 --- a/copy-firmware.sh +++ b/copy-firmware.sh @@ -133,7 +133,7 @@ grep -E '^Link:' WHENCE | sed -e 's/^Link: *//g;s/-> //g' | while read f d; do directory="$destdir/$(dirname "$f")" install -d "$directory" target="$(cd "$directory" && realpath -m -s "$d")" - if test -d "$target"; then + if test -e "$target"; then $verbose "creating link $f -> $d" ln -s "$d" "$destdir/$f" else @@ -143,6 +143,13 @@ grep -E '^Link:' WHENCE | sed -e 's/^Link: *//g;s/-> //g' | while read f d; do fi done +# Verify no broken symlinks +if test "$(find "$destdir" -xtype l | wc -l)" -ne 0 ; then + echo "ERROR: Broken symlinks found:" + find "$destdir" -xtype l + exit 1 +fi + exit 0 # vim: et sw=4 sts=4 ts=4