summaryrefslogtreecommitdiff
path: root/data/live-build-config/hooks/live/40-linux-firmware.chroot
diff options
context:
space:
mode:
Diffstat (limited to 'data/live-build-config/hooks/live/40-linux-firmware.chroot')
-rwxr-xr-xdata/live-build-config/hooks/live/40-linux-firmware.chroot36
1 files changed, 36 insertions, 0 deletions
diff --git a/data/live-build-config/hooks/live/40-linux-firmware.chroot b/data/live-build-config/hooks/live/40-linux-firmware.chroot
new file mode 100755
index 00000000..7cd51ffd
--- /dev/null
+++ b/data/live-build-config/hooks/live/40-linux-firmware.chroot
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+# To get the possibility of reproducible builds we pin to a specific commit
+# of the linux-firmware repository
+COMMIT="7bc246451318b3536d9bfd3c4e46d541a9831b33"
+
+echo I: Retrieving Linux Firmware (commit: ${COMMIT})
+
+wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/snapshot/linux-firmware-${COMMIT}.tar.gz -P /tmp
+tar xf /tmp/linux-firmware-${COMMIT}.tar.gz -C /lib
+mv /lib/linux-firmware-${COMMIT} /lib/firmware
+
+# We do not need all firmware blobs .. cleanup
+RM_FIRMWARE=" \
+ v4l-cx* \
+ s5p-mfc* \
+ nvidia \
+ amdgpu \
+ i915 \
+ radeon \
+ matrox \
+ mediatek \
+ qed \
+ sb16 \
+ ti-connectivity \
+ ueagle-atm \
+ dvb-* \
+ v4l-* \
+ i915 \
+ qcom \
+ ctfw-* \
+ ct2fw-* \
+ "
+for dir in ${RM_FIRMWARE}; do
+ rm -rf /lib/firmware/${dir}
+done