Skip to content

Instantly share code, notes, and snippets.

@ukn
Forked from Stono/99-install-facetime-camera.sh
Last active March 26, 2024 20:35
Show Gist options
  • Star 22 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
  • Save ukn/a2f85e3420ae7d0f64db2274a9bc106b to your computer and use it in GitHub Desktop.
Save ukn/a2f85e3420ae7d0f64db2274a9bc106b to your computer and use it in GitHub Desktop.
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
# For current kernel
export KERNELRELEASE=$(cat /proc/version | awk '{print $3}')
temp_dir=$(mktemp -d)
echo "Installing FacetimeHD camera for $KERNELRELEASE"
cd $temp_dir
git clone https://github.com/patjak/facetimehd-firmware.git
git clone https://github.com/patjak/bcwc_pcie.git
cd $temp_dir/facetimehd-firmware
pwd
make
make install
cd $temp_dir/bcwc_pcie
pwd
make
make install
rm -rf $temp_dir
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
# Workaround for depmod being skipped above with error:
# Warning: modules_install: missing 'System.map' file. Skipping depmod
echo "Generate modules.dep and map files"
sudo depmod
echo "Adding kernel modules"
sudo modprobe -r bdc_pci
sudo modprobe facetimehd
echo "Install complete"
@ghoshpp
Copy link

ghoshpp commented Jan 14, 2023

further, when the directory /lib/modules/5.10.161-1-MANJARO/build was created and make run from bcwc_pcie directory there is a further error message:
make -C /lib/modules/5.10.161-1-MANJARO/build M=/home/partha/Downloads/bcwc_pcie modules
make[1]: Entering directory '/usr/lib/modules/5.10.161-1-MANJARO/build'
make[1]: *** No rule to make target 'modules'. Stop.
make[1]: Leaving directory '/usr/lib/modules/5.10.161-1-MANJARO/build'
make: *** [Makefile:12: all] Error 2

So there is some problem here with the files in the directory; please help....

@ukn
Copy link
Author

ukn commented Jan 16, 2023

No rule to make target 'modules'.

I don't use this setup any more but have you tried searching the web for this error?
Check if you have kernel headers installed that match the current kernel version.

@Memnoc
Copy link

Memnoc commented Jan 6, 2024

I have sort of gathered all I could find on this topic and the gist itself into another repo with some more info. I hope this can be useful to someone struggling with this.
I had a particular rough time making this work on Debian 12, and then this script helped.
Hope this helps!

P.S. sometimes Cheese is picky with the drivers - test on google meet to see if the fix the worked, then tackle Cheese separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment