Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nice installer script #223

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ description-pak
doc-pak
*.deb
*.tgz
src
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ This driver is experimental. Use at your own risk.
See the [Wiki][wiki] for more information:

[wiki]: https://github.com/patjak/bcwc_pcie/wiki

## Install:
If you use arch, install from the AUR. If not, run install.sh as root:
`sudo ./install.sh`
37 changes: 37 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#! /bin/bash
# Some inspiration from the AUR pkgbuild

if [ ! $(whoami) = root ]; then
echo 'You must be root to run this script.'
exit 13
fi

pkgname=bcwc-pcie
pkgver=git
fwurl="https://github.com/patjak/facetimehd-firmware"
fwname=facetimehd-firmware
srcdir=src

rm -rf ${srcdir}
mkdir $srcdir

if [ ! -f /usr/lib/firmware/facetimehd/firmware.bin ]; then
echo 'WARNING: Requires facetimehd-firmware, but it was not found. Installing it for you...'
(cd src; git clone $fwurl $fwname)
pushd ${srcdir}/${fwname} > /dev/null
make
mkdir /usr/lib/firmware/facetimehd/
install -Dm 644 firmware.bin /usr/lib/firmware/facetimehd/firmware.bin
popd > /dev/null
fi

for FILE in dkms.conf Makefile *.[ch]; do
install -Dm 644 "$FILE" "/usr/src/${pkgname}-${pkgver}/$FILE"
done

echo 'Creating modprobe config files'
echo 'facetimehd' > /etc/modules-load.d/bcwc-pcie.conf
echo 'blacklist bdc_pci' > /etc/modprobe.d/bcwc-pcie.conf

echo 'DKMS install for current kernel'
dkms add $pkgname -v $pkgver; dkms install $pkgname -v $pkgver