nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1# Described on https://github.com/patjak/facetimehd/wiki/Extracting-the-sensor-calibration-files
2#
3# The whole download is 518MB; the deflate stream we're interested in is 1.2MB.
4urlRoot="https://download.info.apple.com/Mac_OS_X/031-30890-20150812-ea191174-4130-11e5-a125-930911ba098f"
5curl --insecure -o bootcamp.zip "$urlRoot/bootcamp$version.zip" -r 2338085-3492508
6
7# Add appropriate headers and footers so that zcat extracts cleanly
8
9{ printf '\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\x00'
10 cat bootcamp.zip
11 printf '\x51\x1f\x86\x78\xcf\x5b\x12\x00'
12} | zcat > AppleCamera64.exe
13unrar x AppleCamera64.exe AppleCamera.sys
14
15# These offsets and sizes are from the wiki also
16dd bs=1 skip=1663920 count=33060 if=AppleCamera.sys of=9112_01XX.dat
17dd bs=1 skip=1644880 count=19040 if=AppleCamera.sys of=1771_01XX.dat
18dd bs=1 skip=1606800 count=19040 if=AppleCamera.sys of=1871_01XX.dat
19dd bs=1 skip=1625840 count=19040 if=AppleCamera.sys of=1874_01XX.dat
20
21mkdir -p "$out/lib/firmware/facetimehd"
22cp -a *.dat "$out/lib/firmware/facetimehd"