Skip to content

Instantly share code, notes, and snippets.

Last active Mar 13, 2020
What would you like to do?
Bash script to build a Broadcom Wireless kernel module for CentOS 7 using a Docker container - see
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
DRIVER_SRC=`ls ${DIR}/hybrid*.tar.gz 2> /dev/null`
MYUID=`id -u`
MYGID=`id -g`
if [ ! -f "${DRIVER_SRC}" ]; then
echo "You have to download the Broadcom BCM43xx linux driver archive from Broadcom Official website ( and put it in this diretory."
exit 0
rm -rf ${SDIR}
mkdir -p ${SDIR}/hybrid-wl
tar -xzf ${DRIVER_SRC} -C ${SDIR}/hybrid-wl
wget -q -O ${SDIR}/wl-kmod-fix-ioctl-handling.patch ""
wget -q -O ${SDIR}/wl-kmod-rhel7_1.patch ""
chown -R ${MYUID}:${MYGID} ${SDIR}
sudo docker run -v ${SDIR}:/usr/local/src:Z ${CONTAINER} /bin/sh -c 'cd /usr/local/src/hybrid-wl && patch -p1 < ../wl-kmod-fix-ioctl-handling.patch && patch -p1 < ../wl-kmod-rhel7_1.patch && cd /usr/local/src/hybrid-wl && make -C /lib/modules/${KERNEL_VERSION}.x86_64/build M=`pwd` && strip --strip-debug wl.ko && chown -R '"${MYUID}:${MYGID}"' * .*'
cp ${SDIR}/hybrid-wl/wl.ko ${DIR}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment