Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install the kernal module required for the facetimehd camera to work on Linux
#!/bin/bash
set -e
export CONFIG_MODULE_SIG=n
export CONFIG_MODULE_SIG_ALL=n
export KERNELRELEASE=${1}
echo "Installing FacetimeHD camera for $KERNELRELEASE"
cd /tmp
git clone https://github.com/patjak/bcwc_pcie.git
cd bcwc_pcie/firmware
make
make install
cd ..
make
make install
rm -rf /tmp/bcwc_pcie
if [ ! -d "/etc/modules-load.d" ]; then
mkdir -p "/etc/modules-load.d"
fi
cat > "/etc/modules-load.d/facetimehd.conf" << EOL
videobuf2-core
videobuf2_v4l2
videobuf2-dma-sg
facetimehd
EOL
echo "Install complete."
@Stono

This comment has been minimized.

Copy link
Owner Author

commented Feb 27, 2017

Put this file in /etc/kernel/postinst.d/99-install-facetime-camera.sh and it'll be done each time you update the kernel.
Make sure you have the dependencies mentioned on https://github.com/patjak/bcwc_pcie/wiki/Get-Started

You can 'one shot' run it for your current kernel with /etc/kernel/postinst.d/99-install-facetime-camera.sh $(uname -r)

I'm running Korora (Fedora) 25 on a 2016 Macbook Pro, so that's what this is tested on.

@vablinux

This comment has been minimized.

Copy link

commented Jul 6, 2018

I've tried to install the camera using the tutorial but I got the same error message. So I decided to run your script but I got the same error.

Copying firmware into '//usr/lib/firmware/facetimehd'
make -C /lib/modules//build M=/tmp/bcwc_pcie modules
make[1]: *** /lib/modules//build: No such file or directory. Stop.
make: *** [Makefile:12: all] Error 2

Any help is much appreciated.
Thanks

Vini

@vablinux

This comment has been minimized.

Copy link

commented Jul 6, 2018

I found a solution. Followed this instructions https://github.com/patjak/bcwc_pcie/wiki/Get-Started#get-started-on-fedora
Then I installed sudo yum install elfutils-libelf-devel
Facetime camera working fine on my macbook pro with fedora 28

@jpretori

This comment has been minimized.

Copy link

commented Apr 4, 2019

Thanks!
I get this problem though - can you help?

make[1]: Entering directory '/usr/src/linux-headers-4.18.0-17-generic'
  INSTALL /tmp/bcwc_pcie/facetimehd.ko
At main.c:160:
- SSL error:02001002:system library:fopen:No such file or directory: ../crypto/bio/bss_file.c:74
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: ../crypto/bio/bss_file.c:81
sign-file: certs/signing_key.pem: No such file or directory
  DEPMOD  4.18.0-17-generic
@gonzaloFigueras

This comment has been minimized.

Copy link

commented Apr 27, 2019

Hello, I have tried the script but I am getting the following error:

**Installing FacetimeHD camera for
Cloning into 'bcwc_pcie'...
remote: Enumerating objects: 1049, done.
remote: Total 1049 (delta 0), reused 0 (delta 0), pack-reused 1049
Receiving objects: 100% (1049/1049), 350.72 KiB | 503.00 KiB/s, done.
Resolving deltas: 100% (707/707), done.

Checking dependencies for driver download...
/usr/bin/xzcat
/bin/cpio
Makefile:34: fallo en las instrucciones para el objetivo 'AppleCameraInterface'
make: *** [AppleCameraInterface] Error 1**

I don't know what to do here. I am stucked.

Thanks in advanced!

@erwinfeser

This comment has been minimized.

Copy link

commented May 2, 2019

This script seems to be outdated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.