summaryrefslogtreecommitdiffstats
path: root/openpower/scripts
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2016-07-19 15:03:56 +1000
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2016-07-20 15:45:28 +1000
commitd5d10af9d11a8db804f6794640695e97f779d5fd (patch)
tree07eba0961431b34bb35381e181e02db6aba4e582 /openpower/scripts
parent907068c54c76d655486175e2e06484e69d1d1485 (diff)
downloadtalos-op-build-d5d10af9d11a8db804f6794640695e97f779d5fd.tar.gz
talos-op-build-d5d10af9d11a8db804f6794640695e97f779d5fd.zip
scripts: Add firenze-firmware-whitelist script
Firenze builds require several radeon binaries from linux-firmware, however the buildroot package installs support for many more varieties than we need. Add a post-build script that compares installed firmware binaries against a whitelist and removes any unnecessary binaries. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Diffstat (limited to 'openpower/scripts')
-rwxr-xr-xopenpower/scripts/firenze-firmware-whitelist46
1 files changed, 46 insertions, 0 deletions
diff --git a/openpower/scripts/firenze-firmware-whitelist b/openpower/scripts/firenze-firmware-whitelist
new file mode 100755
index 00000000..801ef8b4
--- /dev/null
+++ b/openpower/scripts/firenze-firmware-whitelist
@@ -0,0 +1,46 @@
+#!/bin/bash
+# Scan the /lib/firmware directory of the target and delete any firmware
+# binaries that are not in our whitelist
+
+# A whitelist of entire directories or specific binary files
+whitelist=( 'acenic'
+ 'bnx2'
+ 'bnx2x'
+ 'cxgb4'
+ 'cxgb3'
+ 'e100'
+ 'radeon/CAICOS_me.bin'
+ 'radeon/CEDAR_rlc.bin'
+ 'radeon/CAICOS_mc.bin'
+ 'radeon/CAICOS_pfp.bin'
+ 'radeon/CEDAR_pfp.bin'
+ 'radeon/CAICOS_smc.bin'
+ 'radeon/CEDAR_smc.bin'
+ 'radeon/CEDAR_me.bin'
+ 'radeon/CYPRESS_uvd.bin')
+
+if [ -z "${TARGET_DIR}" ] ; then
+ echo "TARGET_DIR not defined, setting to $1"
+ TARGET_DIR=$1
+fi
+
+files=$(find ${TARGET_DIR}/lib/firmware/*)
+for file in ${files};
+do
+ if [ -d $file ] ; then
+ continue
+ fi
+
+ found=0
+ for item in ${whitelist[@]};
+ do
+ if [ "${file/${item}}" != "${file}" ] ; then
+ found=1
+ break
+ fi
+ done
+
+ if [ "${found}" -ne "1" ] ; then
+ rm -v ${file}
+ fi
+done
OpenPOWER on IntegriCloud