summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorCyril Brulebois <ckb@riseup.net>2020-03-07 06:30:45 +0100
committerCyril Brulebois <ckb@riseup.net>2020-03-08 04:37:46 +0100
commitcfca4d4a0ec4d5b2073d999f5fbcc4eaf7d32fc6 (patch)
tree7cb7cef9854e9800a66f88e280c725d51172049f /config
parent060605c0778a1ff688747737cdad1408ace75c81 (diff)
Fix missing firmware for RTL8822BE/RTL8822CE (refs: #17323).
Use the tails-workarounds provided firmwares until the firmware-realtek package is updated with the patch by Sjoerd Simons (Debian#935969).
Diffstat (limited to 'config')
-rwxr-xr-xconfig/chroot_local-hooks/49-fix-missing-rtw88-firmware35
1 files changed, 35 insertions, 0 deletions
diff --git a/config/chroot_local-hooks/49-fix-missing-rtw88-firmware b/config/chroot_local-hooks/49-fix-missing-rtw88-firmware
new file mode 100755
index 0000000..0546192
--- /dev/null
+++ b/config/chroot_local-hooks/49-fix-missing-rtw88-firmware
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+set -e
+set -u
+
+echo "Checking for possibly missing rtw88 firmware (#17323)"
+
+# Decide where to copy from, and what:
+WORKAROUNDS_FW_DIR='/tmp/tails-workarounds/linux-firmware'
+DIR='rtw88'
+FILES='rtw8822b_fw.bin rtw8822c_fw.bin'
+
+# Sanity check:
+orig_dir="$WORKAROUNDS_FW_DIR/$DIR"
+if [ ! -d "$orig_dir" ]; then
+ echo "=> ERROR: Missing origin directory ($orig_dir)"
+ exit 1
+fi
+
+firmware_dir="/lib/firmware/$DIR"
+if [ ! -d "$firmware_dir" ]; then
+ echo "=> Missing parent directory ($firmware_dir), creating"
+ mkdir -p "$firmware_dir"
+fi
+
+
+for file in $FILES; do
+ path="$firmware_dir/$file"
+ if [ ! -f "$path" ]; then
+ echo "=> Missing firmware ($file), copying"
+ cp "$orig_dir/$file" "$path"
+ else
+ echo "=> WARNING: Firmware for $file found, maybe this hook could be dropped"
+ fi
+done