forked from OpenMandrivaAssociation/kernel-firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen-firmware-lists.sh
executable file
·51 lines (51 loc) · 947 Bytes
/
gen-firmware-lists.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash -e
[ -e WHENCE ] || { echo "Usage: cd linux-firmware ; $0" >&2; exit 1; }
rm -f free.list nonfree.list
cat WHENCE | while read line; do
set -e
case "$line" in
"Driver: "*)
driver="${line#Driver: }"
free=
files=
license=
;;
"File: "*|"sl: "*)
files="$files ${line#File: }"
;;
"Source: "*)
free=1
files="$files ${line#Source: }"
;;
"License: "*|"Licence: "*)
license="${line#Licen?e: }"
case "$license" in
*"Allegedly"*|*"no source visible"*)
;;
*"GPL"*)
free=1
;;
esac
;;
"Original licence information: None")
free=
;;
"------"*)
if echo $files |grep -q radeon; then
LIST=radeon
elif echo $files | grep -qe iwlwifi -qe ibt-hw; then
LIST=iwlwifi
elif [ -n "$free" ]; then
LIST=free
else
LIST=nonfree
fi
for file in $files; do
[ -e $file ] && echo /lib/firmware/$file >>$LIST.list
done
echo "$LIST: $driver ($license)"
driver=
files=
;;
esac
done