]> git.saurik.com Git - cydia.git/blame - Library/firmware.sh
Ported to latest firmware and fixed locales.
[cydia.git] / Library / firmware.sh
CommitLineData
de0dbbab
JF
1#!/bin/bash
2
3version=$(sw_vers -productVersion)
4
5if grep '^Package: firmware$' /var/lib/dpkg/status >/dev/null; then
e057ec05 6 cat /var/lib/dpkg/status | while IFS= read -r line; do
de0dbbab
JF
7 if [[ ${line} == 'Package: firmware' ]]; then
8 firmware=
9 elif [[ ${line} == '' ]]; then
10 unset firmware
11 elif [[ ${line} == Version:* && "${firmware+@}" ]]; then
12 echo "Version: ${version}"
13 continue
14 fi
15
16 echo "${line}"
17 done >/var/lib/dpkg/status_
18else
19 cat /var/lib/dpkg/status - >/var/lib/dpkg/status_ <<EOF
20Package: firmware
21Essential: yes
22Status: install ok installed
23Priority: required
24Section: System
25Installed-Size: 0
26Maintainer: Jay Freeman (saurik) <saurik@saurik.com>
27Architecture: darwin-arm
28Version: ${version}
29Description: almost impressive Apple frameworks
7e8e5d66 30Name: iPhone Firmware
de0dbbab
JF
31
32EOF
33fi && mv -f /var/lib/dpkg/status{_,}
34
fa22c13d
JF
35echo "/." >/var/lib/dpkg/info/firmware.list
36
de0dbbab
JF
37if [[ ${version} = 1.0* || ${version} = 1.1.[012] ]]; then
38 user=root
39else
40 user=mobile
41fi
42
43if [[ ! -h /User && -d /User ]]; then
44 cp -afT /User /var/"${user}"
45fi && rm -rf /User && ln -s "/var/${user}" /User