mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git
synced 2025-01-12 10:00:08 +00:00
07b925b450
The current make-install procedure leaves lots of garbage files that aren't really firmware files in /lib/firmware. Instead of copy-all-and-prune approach, copy only the listed files and links in WHENCE by make-install for assuring only the proper firmware files. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Josh Boyer <jwboyer@kernel.org>
31 lines
643 B
Bash
Executable File
31 lines
643 B
Bash
Executable File
#!/bin/sh
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
#
|
|
# Copy firmware files based on WHENCE list
|
|
#
|
|
|
|
verbose=:
|
|
if [ x"$1" = x"-v" ]; then
|
|
verbose=echo
|
|
shift
|
|
fi
|
|
|
|
destdir="$1"
|
|
|
|
grep '^File:' WHENCE | sed -e's/^File: *//g' -e's/"//g' | while read f; do
|
|
test -f "$f" || continue
|
|
$verbose "copying file $f"
|
|
mkdir -p $destdir/$(dirname "$f")
|
|
cp -d "$f" $destdir/"$f"
|
|
done
|
|
|
|
grep -E '^Link:' WHENCE | sed -e's/^Link: *//g' -e's/-> //g' | while read f d; do
|
|
test -L "$f" || continue
|
|
test -f "$destdir/$f" && continue
|
|
$verbose "copying link $f"
|
|
mkdir -p $destdir/$(dirname "$f")
|
|
cp -d "$f" $destdir/"$f"
|
|
done
|
|
|
|
exit 0
|