Created
July 8, 2025 13:34
-
-
Save iandark/aca2b2a0553a16f78120125a32cf5d3b to your computer and use it in GitHub Desktop.
Script to install and configure the FaceTime HD camera driver and firmware on Arch Linux with Wayland.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -e | |
| echo "[0/5] Checking basic dependencies..." | |
| if ! command -v cpio &> /dev/null; then | |
| echo "cpio not found, installing..." | |
| sudo pacman -S --noconfirm cpio | |
| fi | |
| echo "[1/5] Installing dependencies..." | |
| sudo pacman -Syu --needed base-devel git linux-headers --noconfirm | |
| echo "[2/5] Cloning and installing the bcwc-pcie-git driver..." | |
| cd /tmp | |
| rm -rf bcwc-pcie-git | |
| git clone https://aur.archlinux.org/bcwc-pcie-git.git | |
| cd bcwc-pcie-git | |
| echo "[2.1] Removing invalid dependency (facetimehd-firmware)..." | |
| awk ' | |
| /^depends=/ { | |
| gsub(/'\''facetimehd-firmware'\'',?[[:space:]]*/, "") | |
| gsub(/,[[:space:]]*'\''facetimehd-firmware'\''/, "") | |
| gsub(/'\''facetimehd-firmware'\''/, "") | |
| gsub(/\([[:space:]]*\)/, "()") | |
| } | |
| { print } | |
| ' PKGBUILD > PKGBUILD.new && mv PKGBUILD.new PKGBUILD | |
| makepkg -si --noconfirm --skippgpcheck --nocheck | |
| echo "[3/5] Installing facetimehd firmware..." | |
| cd /tmp | |
| rm -rf facetimehd-firmware | |
| git clone https://github.com/patjak/facetimehd-firmware.git | |
| cd facetimehd-firmware | |
| make clean | |
| make | |
| sudo make install | |
| echo "[4/5] Loading kernel module..." | |
| echo facetimehd | sudo tee /etc/modules-load.d/facetimehd.conf | |
| sudo modprobe facetimehd | |
| echo "[5/5] Checking camera..." | |
| if [[ -e /dev/video0 ]]; then | |
| echo "✅ Camera detected at /dev/video0" | |
| else | |
| echo "⚠️ Camera not detected. Check with: dmesg | grep -i facetime" | |
| fi | |
| # To install programs for camera testing: | |
| # sudo pacman -S mpv ffmpeg | |
| ## To activate the device: | |
| ## sudo modprobe facetimehd | |
| ## | |
| ## To test: | |
| ## ffplay /dev/video0 | |
| ## or | |
| ## mpv av://v4l2:/dev/video0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment