kernel-firmware/install-split.sh
Takashi Iwai 539c33453e Accepting request 742085 from home:tiwai:branches:Kernel:HEAD
- Update to version 20191022 (git-commit: 2b016afc348b):
  * linux-firmware: Update AMD cpu microcode
  * linux-firmware: Update firmware file for Intel Bluetooth AX200
  * linux-firmware: Update firmware file for Intel Bluetooth AX201
  * linux-firmware: Update firmware file for Intel Bluetooth 9560
  * linux-firmware: Update firmware file for Intel Bluetooth 9260
  * amdgpu: add initial navi14 firmware form 19.30
  * rtlwifi: rtl8821ae: Add firmware for the RTL8812AE variant.
  * ice: Fix up WHENCE entry and symlink
  * nvidia: Update Tegra210 XUSB firmware to v50.24
  * nvidia: Add XUSB firmware for Tegra194
  * Remove duplicate symlinks
  * copy-firmware: Create symlinks from WHENCE file
  * Make symlinks consistent
  * amdgpu: update vega20 ucode for 19.30
  * amdgpu: update vega12 ucode for 19.30
  * amdgpu: update vega10 ucode for 19.30
  * amdgpu: update picasso ucode for 19.30
  * amdgpu: update raven2 ucode for 19.30
  * amdgpu: update raven ucode for 19.30
  * amdgpu: add new raven rlc firmware
  * ice: Add package file for Intel E800 series driver
  * amdgpu: add initial navi10 firmware
  * drm/i915/firmware: Add v9.0.0 of HuC for Icelake
  * drm/i915/firmware: Add v4.0.0 of HuC for Cometlake
  * drm/i915/firmware: Add v4.0.0 of HuC for Geminilake
  * drm/i915/firmware: Add v2.0.0 of HuC for Broxton
  * drm/i915/firmware: Add v4.0.0 of HuC for Kabylake
  * drm/i915/firmware: Add v2.0.0 of HuC for Skylake
  * drm/i915/firmware: Add v33 of GuC for CML

OBS-URL: https://build.opensuse.org/request/show/742085
OBS-URL: https://build.opensuse.org/package/show/Kernel:HEAD/kernel-firmware?expand=0&rev=275
2019-10-23 09:50:13 +00:00

143 lines
2.9 KiB
Bash

#!/bin/sh
#
# Read WHENCE from stdin and install the compressed firmware files into DESTDIR.
# The file list for each topic is created as files-xxx under the current dir.
#
# usage: install-split.sh [-v] topics.list DESTDIR < WHENCE
#
verbose=:
if [ x"$1" = x"-v" ]; then
verbose=echo
shift
fi
topics="$1"
DESTDIR="$2"
fwdir=/lib/firmware
dest=$DESTDIR/$fwdir
do_compress=1
if [ -n "$do_compress" ]; then
cext=".xz"
else
cext=""
fi
make_dirs () {
local f="$1"
mkdir -p $(dirname "$dest/$f")
local d=$(dirname "$f")
if [ "$d" != "." ]; then
while true; do
if ! grep -q '%dir '"$fwdir/$d"'$' files-$topic; then
echo "%dir $fwdir/$d" >> files-$topic
fi
case "$d" in
*/*) d=${d%/*};;
*) break;;
esac
done
fi
}
copy_link () {
local f="$1"
local lf="$2"
test -f "$dest/$f$cext" && return
test -z "$lf" && lf=$(readlink "$f")
make_dirs "$f"
ln -sf "$lf$cext" "$dest/$f$cext"
echo "\"$fwdir/$f$cext\"" >> files-$topic
$verbose "Link: $lf$cext -> $f$cext for topic $topic"
}
copy_file () {
local f="$1"
test -f "$dest/$f$cext" && return
make_dirs "$f"
install -c -m 0644 "$f" $(dirname "$dest/$f")
test -n "$do_compress" && xz -f -C crc32 "$dest/$f"
echo "\"$fwdir/$f$cext\"" >> files-$topic
$verbose "Copy: $f$cext for topic $topic"
}
sub="xxx"
while read l; do
test -z "$l" && continue
case "$l" in
----*)
sub=""
topic=""
;;
Driver:*)
test -n "$sub" && continue
sub=$(echo "$l" | sed -e's/Driver: *//' -e's/[ :].*$//')
m=$(grep -m1 "^$sub": "$topics" | sed -e's/^.*:[[:space:]]*//')
test -z "$m" && continue
set -- $m
topic="$1"
if [ "$topic" = "SKIP" ]; then
continue
fi
$verbose "Switching to topic $topic"
if [ -n "$topic" ]; then
if [ ! -s files-$topic ]; then
echo "%dir /lib/firmware" > files-$topic
fi
fi
;;
File:*)
test "$topic" = "SKIP" && continue
if [ -z "$topic" ]; then
echo "ERROR: no topic found for $l"
exit 1
fi
f=$(echo "$l" | sed -e's/^File: *//' -e's/"//g')
if [ -L "$f" ]; then
copy_link "$f"
else
copy_file "$f"
fi
;;
esac
done
sub="xxx"
while read l; do
test -z "$l" && continue
case "$l" in
----*)
sub=""
topic=""
;;
Driver:*)
test -n "$sub" && continue
sub=$(echo "$l" | sed -e's/Driver: *//' -e's/[ :].*$//')
m=$(grep -m1 "^$sub": "$topics" | sed -e's/^.*:[[:space:]]*//')
test -z "$m" && continue
set -- $m
topic="$1"
if [ "$topic" = "SKIP" ]; then
continue
fi
;;
Link:*)
test "$topic" = "SKIP" && continue
if [ -z "$topic" ]; then
echo "ERROR: no topic found for $l"
exit 1
fi
echo "$l" | sed -e's/^Link: *//g' -e's/-> //g' | while read f d; do
if test -L "$f"; then
copy_link "$f"
else
copy_link "$f" "$d"
fi
done
;;
esac
done