diff --git a/.gitignore b/.gitignore index 99a46ca..f624a38 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ description-pak doc-pak *.deb *.tgz +src diff --git a/README.md b/README.md index f1d6970..6b5a7ff 100644 --- a/README.md +++ b/README.md @@ -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` diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..79c4c90 --- /dev/null +++ b/install.sh @@ -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