mirror of
https://gitlab.com/kernel-firmware/linux-firmware.git
synced 2026-03-14 21:20:10 +01:00
copy-firmware.sh: call ./check_whence.py before parsing the file
Currently ./check_whence.py is used when submitting new firmware, while copy-firmware.sh when the firmware is to be consumed. Since the latter does (very little) validation, having a malformed WHENCE file can lead to all sorted of problems. From the obvious, where it errors out, to more serious one where it overwrites or executes something it should not have. Just call check_whence.py and error out. It takes 0.2s on my 5 year old mid-range laptop, so the overhead is negligible. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Link: https://lore.kernel.org/r/20240923-misc-fixes-v2-13-397f23443628@gmail.com Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
This commit is contained in:
parent
bf54edbe87
commit
8a441a3cf2
1 changed files with 3 additions and 0 deletions
|
|
@ -71,6 +71,9 @@ if test -d "$destdir"; then
|
|||
find "$destdir" -type d -empty >/dev/null || warn "destination folder is not empty."
|
||||
fi
|
||||
|
||||
$verbose "Checking that WHENCE file is formatted properly"
|
||||
./check_whence.py || err "check_whence.py has detected errors."
|
||||
|
||||
# shellcheck disable=SC2162 # file/folder name can include escaped symbols
|
||||
grep -E '^(RawFile|File):' WHENCE | sed -E -e 's/^(RawFile|File): */\1 /;s/"//g' | while read k f; do
|
||||
test -f "$f" || continue
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue